Processing system with dynamic alteration of a color look-up table

ABSTRACT

A method and apparatus for dynamic alteration of a color look-up table (CLUT) pallet identifier in response to one or more key codes placed in an input data stream. An input data stream including a sequence of input data blocks is converted into a stream suitable for addressing a look-up table. The look-up table may be a 256×16 table which requires an 8-bit address to identify a particular table entry. The invention allows such a table to be addressed using 4-bit data blocks in the input data stream. For each received 4-bit data block in the input data stream, a determination is made as to whether that block corresponds to a predetermined key value. If a given input block does not correspond to the predetermined key value, the 4-bit input block is combined with a previously-stored 4-bit pallet identifier to generate an 8-bit address into the look-up table. The pallet identifier specifies one of 16 different 16-entry pallets within the 256×16 look-up table. If the given input block does correspond to the key value, a new 4-bit pallet identifier is stored. The new pallet identifier may be contained within a data block which immediately follows the key value block in the data stream. The new pallet identifier is then used in combination with subsequent 4-bit data blocks in the stream to generate 8-bit addresses into the look-up table.

RELATED APPLICATIONS

The present application is related to the following U.S. patentapplications, all filed concurrently herewith and assigned to thepresent assignee: Ser. No. 08/729,545 entitled "Processing System WithGraphics Data Prescaling"; Ser. No. 08/728,678 entitled "ProcessingSystem With Simultaneous Utilization of Multiple Clock Signals", nowU.S. Pat. No. 5,790,842; Ser. No. 08/729,544 entitled "Processing SystemWith Register-Based Process Sharing"; Ser. No. 08/731,343 entitled"Processing System With Memory Arbitration Between Memory Access Resultsin a Set Top Box", now U.S. Pat. No. 5,889,949; Ser. No. 08/731,218entitled "Processing System With Delta-Based Video Data Encoding", nowU.S Pat. No. 5,793,427; Ser. No. 08/731,217 entitled "Processing SystemWith Single-Buffered Display Capture"; and Ser. No. 08/731,285 entitled"Processing System With Pointer-Based ATM Segmentation and Reassembly."

FIELD OF THE INVENTION

The present invention relates generally to video, audio, graphics,input/output and other processing functions in set top box applications.More particularly, the present invention relates to a processing systemwith an application specific integrated circuit (ASIC) processor whichprovides video, audio, graphics and input/output processing functionsand is particularly well-suited for use in set top box applications.

BACKGROUND OF THE INVENTION

Multimedia distribution systems are becoming increasingly importantvehicles for delivering video, audio and other data to and from remoteusers. Such distribution systems include cable or community accesstelevision (CATV) systems, telephone systems and computer networks. Aset top box may be used as an interface between the distribution systemand a television set, computer or other type of remote user terminal.The set top box typically provides functions such as input/outputprocessing of video, audio and other data, audio and videodemultiplexing and decompression, graphics overlay processing for use inelectronic program guides and the like, entitlement control for video ondemand (VOD), near video on demand (NVOD) and pay-per-view (PPV)applications, and remote control user interfaces.

A conventional set top box generally provides the above-noted functionsusing a multiplicity of dedicated stand-alone integrated circuits, eachhaving its own separate support circuitry and protocols to provide, forexample, memory access and other processing functions. This may beattributed in part to the fact that many of the circuits used in set topbox applications are general-purpose devices designed to support a broadarray of applications. As a result, there is considerable overlap inmany of the circuit functions, as well as potential incompatibilitieswhich lead to slower processing speed and other inefficiencies. Theconventional set top boxes are therefore not only unduly complex andexpensive, but also fail to provide optimal levels of performance.Widespread implementation of multimedia distribution systems usingcable, telephone and/or computer networks will depend in large part uponreducing the complexity and cost of set top box hardware.

As is apparent from the above, there is a need for an improvedprocessing system suitable for use in set top box applications and whichcan be configured to utilize shared processing hardware to therebyprovide video, audio, graphics, input/output communication and otherfunctions with improved efficiency and reduced cost and complexity.

SUMMARY OF THE INVENTION

The present invention involves apparatus and methods for providingvideo, audio, graphics, input/output communication and other processingfunctions in set top boxes and other applications with reduced cost andcomplexity. In one embodiment, the invention is implemented as anapplication-specific integrated circuit (ASIC) processor suitable foruse in a set top box or other processing system to improve hardwareefficiency and throughput performance relative to conventional systems.

One aspect of the invention involves a method and apparatus forprescaling graphics data for use in a graphics overlay operating mode.In an exemplary embodiment, a method and apparatus are provided forprocessing a stream of RGB pixel data in a graphics processor. The RGBpixel data for a given pixel are first converted to luminance andchrominance data for that pixel. The luminance and chrominance data arethen prescaled by a blending value associated with the given pixel. Aninterpolation operation is performed on the luminance and chrominancedata as well as on the blending value for the given pixel usingcorresponding luminance and chrominance data and blending values for atleast one other pixel in the stream. This interpolation may includeoperations such as horizontal filtering and may also include chromafiltering to convert the luminance and chrominance data into a 4:2:2chrominance format compatible with MPEG-2 video. The interpolationoperation produces interpolated luminance and chrominance data and aninterpolated blending value for the given pixel. A video signal to becombined with the graphics data is then scaled using the interpolatedblending value. The scaled video signal is combined with theinterpolated luminance and chrominance data for the given pixel toprovide a combined video/graphics signal suitable for display.

Another aspect of the invention involves a technique for dynamicalteration of a color look-up table (CLUT) pallet identifier in responseto one or more key codes placed in an input data stream. In an exemplaryembodiment, a method and apparatus are provided for converting an inputdata stream including a sequence of input data blocks into a convertedstream suitable for addressing a look-up table. The look-up table may bea 256×16 table which requires an 8-bit address to identify a particulartable entry. The present invention allows such a table to be addressedusing 4-bit data blocks in the input data stream. For each received4-bit data block in the input data stream, a determination is made as towhether that block corresponds to a predetermined key value. If a giveninput block does not correspond to the predetermined key value, the4-bit input block is combined with a previously-stored 4-bit palletidentifier to generate an 8-bit address into the look-up table. Thepallet identifier specifies one of 16 different 16-entry pallets withinthe 256×16 look-up table. If the given input block does correspond tothe key value, a new 4-bit pallet identifier is stored. The new palletidentifier may be contained within a data block which immediatelyfollows the key value block in the data stream. The new palletidentifier is then used in combination with subsequent 4-bit data blocksin the stream to generate 8-bit addresses into the look-up table. Thisarrangement provides substantial improvements in table addressingefficiency and is particularly well-suited for use in graphicsprocessors which generate graphics data using color look-up tables.

Another aspect of the invention relates to a technique for permittingsimultaneous utilization of two system clocks in applications in whichcertain processing system elements utilize one system clock operating ata non-integer multiple of another system clock used by other processingsystem elements. For example, a processing system may include a videodecoder and/or an NTSC encoder which operate with a first clock at 27MHz. The processing system may also include an ASIC processor operatingwith a second clock at 40.5 MHz. A synchronous phase detector is used togenerate a clock enable signal suitable for use in a pipeline structureto facilitate data transfer between the different elements of theprocessing system. An exemplary circuit may include two or more D-typeflip-flops or other data storage devices. The first clock signal isapplied to a clock input of a first data storage device, and the secondclock is applied to a data input of the first data storage device. Thesecond clock is also applied to a clock input of at least one additionaldata storage devices connected in series with the first data storagedevice. The output of the first data storage device is applied to thedata input of a second data storage device, the output of the second isapplied to the data input of a third, and so on. The clock enable signalis provided at the output of the fourth data storage device. The clockenable signal includes phase information extracted from the first andsecond clock signals, and is suitable for use in driving one or moremultiplexers in a pipeline structure or other state-based logic deviceto thereby allow data transfer between an element of the processingsystem operating at the first clock rate and an element operating at thesecond clock rate.

Another aspect of the invention involves a differential video dataencoding technique which utilizes a reduced number of bits per pixel toencode chroma and luma components of a video data stream. In anexemplary embodiment, a 4-bit absolute code is determined for a given8-bit luma or chroma component in the data stream. The determinedabsolute code is indicative of a particular one of a plurality of rangesinto which the given component falls. The given component is encodedusing the determined absolute code if the absolute code produces a lowerencoding error than a 4-bit delta code which encodes the component as adifference relative to a previously-encoded component. If the delta codeproduces a lower encoding error than the determined absolute code, thegiven component is encoded using the delta code. In a situation in whichthe given component is the first component of its type on a line ofvideo, an absolute code may be used regardless of whether or not theabsolute code produces a higher encoding error than the delta code. Thenumber of 4-bit absolute codes may be selected as fourteen, such thateach absolute code specifies one of fourteen possible ranges into whichthe given component may fall. The remaining two 4-bit delta codesspecify whether a predetermined value should be added to or subtractedfrom the value of a previously-encoded component. Alternatively, thenumber of 4-bit absolute codes may be selected as eleven, such that eachabsolute code specifies one of eleven possible ranges into which thegiven component may fall. The remaining five 4-bit delta codes specifywhether a first predetermined value should be added to or subtractedfrom the value of the previously-encoded component, whether a secondpredetermined value should be added to or subtracted from the value ofthe previously-encoded component, or whether the given component shouldbe encoded using the same value as the previously-encoded component.Numerous other arrangements of absolute and delta codes could also beused.

Another aspect of the invention relates to a single-buffered displaycapture technique. The display capture technique eliminates a "tearing"problem which arises when a top portion of a displayed video image isfrom a current frame, while a bottom portion of the displayed image isfrom a previous frame. An exemplary embodiment includes an apparatus forprocessing a video signal in a processing system, wherein the videosignal including a sequence of frames each having an even field and anodd field. The apparatus includes a video capture circuit which receivesthe video signal from a video source, and a video display circuit whichhas an input coupled to an output of the video capture circuit. Thevideo capture circuit captures a first set of lines in an even field ofthe video signal during a time period in which the video display circuitdisplays a second set of lines in the even field. The video capturecircuit also captures the second set of lines in an odd field of thevideo signal during a time period in which the video display circuitdisplays the first set of lines in the odd field. The video capturecircuit utilizes an odd-numbered decimation factor to determine thefirst and second sets of lines from all lines in the even and oddfields.

Another aspect of the invention involves a technique for utilizing ahardware register to prevent interference between simultaneously-runningprocesses which attempt to access certain processing hardware such as adrawing acceleration engine. In a exemplary embodiment, a method andapparatus are provided for controlling access of a plurality ofprocesses to a graphics engine in a graphics processor. The graphicsprocessor or other device such as a CPU associated with the processorincludes a register with an acquire bit portion and a process identifierportion. When a given process requests access to the graphics engine, adetermination is made as to whether the acquire bit of the register isset. A set acquire bit indicates that some process has already beengranted access to the engine. If the acquire bit is not set, therequesting process is granted access to the engine, and its processidentifier is stored in the process identifier portion of the register.If the acquire bit is already set when the given process requests accessto the engine, the identifier for that process is compared to theidentifier stored in the process identifier portion of the register. Ifthe identifiers match, the requesting process is granted access. Thelack of a match between the identifiers indicates that a differentprocess has previously been granted access to the engine, and therequesting process is therefore denied access to the engine. When aprocess granted access to the engine no longer requires access, theacquire bit is cleared. This hardware-based sharing mechanism allowsmultiple processes to share common state-sensitive graphics hardwaresuch as a drawing acceleration engine.

Another aspect of the invention is directed to a memory arbitrationtechnique which allows multiple hardware functions implemented in asingle ASIC to utilize a single shared memory unit or multiple sharedmemory units. The memory arbitration technique establishes a priorityamong multiple memory access requestors which is particularlywell-suited for use in a set top box processing system. This aspect ofthe invention significantly reduces the complexity of a set top box orother processing system in that separate memory controllers areeliminated and memory conflicts are considerably reduced. An exemplaryembodiment provides a method of arbitrating between a plurality ofmemory access requests received from a plurality of processing elementsin a set top box processing system. The processing elements include atransport stream demultiplexer, a host central processing unit and agraphics processor. The method involves the steps of receiving thememory access requests from the processing elements, and permitting theprocessing elements to access a shared memory in accordance with anestablished priority. The established priority assigns a higher priorityto the graphics processor than to the host central processing unit, andmay be in the order of graphics processor, transport streamdemultiplexer, and central processing unit. In an embodiment in whichthe plurality of processing elements includes an asynchronous transfermode (ATM) processing element, the established priority may assign thelowest priority to the memory access requests of the ATM processingelement.

Another aspect of the invention involves an ATM segmentation andreassembly (SAR) device which provides efficient transfer of ATM celldata between a set top box or other processing system and an ATMnetwork. The SAR device provides filtering of a stream of received ATMcells by comparing the virtual channel indicators (VCIs) of the incomingcells with a plurality of indicators stored in a receive VCI table. Agiven cell is accepted if the VCI for that cell matches one of thestored indicators. At least one additional stored indicator may be usedas a hash table to provide a matching function for a number ofadditional VCIs. If the VCI for the given received cell does not matchone of the stored indicators in the receive VCI table, at least aportion of the VCI for that cell can be used as a bit index into thehash table provided by the additional stored indicator. The givenreceived cell is accepted if the hash table bit designated by theportion of the VCI used as a bit index has a predetermined value. Theindicator table may be implemented as a 16×16 random access memory tablein which the first 15 entries represent VCI values to be accepted by areceiver, and the last entry represents a 16-bit hash table such thatthe four least significant bits of a given received VCI are used as abit index into the table. A given received cell is discarded if its VCIdoes not match one of the identifiers stored in the identifier table andif its corresponding hash table bit does not have the predeterminedvalue.

The SAR device also provides an improved technique for storing receivedATM cells which facilitates the reassembly process. An exemplaryembodiment uses a receive ring which stores an array of pointers. Eachof the pointers specifies the address of a cell buffer suitable forstoring an ATM cell. Received ATM cells are first filtered to determineif the cells should be accepted in the SAR device. As noted above, thisfiltering may be based on a comparison of the incoming cell VCIs withentries in a receive VCI table. When a given cell is accepted, a pointerretrieved from the receive ring is used to determine the address of acell buffer in which that cell will be stored. Host CPU softwaredirecting the operation of the SAR device periodically services thereceive ring to prevent overflow. The periodic servicing of the receivering may be triggered by a flag indicating that all or most availablereceive ring pointers are already in use. The host CPU software thenservices the receive ring by sequentially stepping through the ringentries and linking the pointer for each stored cell into a chain ofpointers maintained for the VCI on which that stored cell was received.The pointers which are linked into a chain are removed from the receivering and replaced with pointers to empty cell buffers so that additionalreceive cells can be processed and stored. When an end-of-frameindicator is detected in a cell received on a given VCI, the host CPUsoftware uses the pointers in the chain maintained for that VCI, as wellas any pointers for that VCI remaining in the receive ring, toreassemble an AAL5 frame. A cumulative frame cyclic redundancy code(CRC) is computed using dedicated hardware in a CRC processor. The hostCPU software uses the pointers to direct the CRC processor to each cellof the frame in turn, until the full frame CRC is computed. The frame isthen accepted or rejected based on a comparison of the computed fullframe CRC with the CRC field of the frame trailer. An accepted frame maybe passed to upper protocol layers for additional processing, and iseventually written to application buffers such that the cell buffers andcorresponding pointers are free to be reused for subsequently-receivedcells. The cell buffers and corresponding pointers for a rejected framemay be made immediately available for reuse.

The SAR device also provides improved segmentation by utilizing a hostCPU to direct the transmission of stored cells in accordance with anarray of pointers stored in a transmit ring. In one possible embodiment,host CPU software directs the realignment of stored cell data usingdedicated hardware in the form of a CRC processor. The CRC processorcomputes a full frame CRC as it carries out the cell data realignmentunder the direction of the host CPU software. The full frame CRC isretrieved from the CRC processor and inserted into an AAL5 trailer inthe last cell of a frame to be transmitted. The host CPU software thenloads the transmit ring with pointers identifying the cell bufferscontaining the ATM cells of the frame to be transmitted. A transmitterin the SAR device retrieves a pointer from the transmit ring and thenretrieves the corresponding ATM cell identified by the pointer. Thetransmitter then transmits the retrieved cell to the ATM physical layerinterface via a UTOPIA port. The host software periodically services thetransmit ring to return pointers for already-transmitted cells to a listof available pointers, and to load the transmit ring with pointers fornew cells to be transmitted. The software loads the pointers such that aquality of service transmission rate established for a given VCI is notexceeded, and may direct the interleaving of cells from multiple VCIs aswell as the insertion of pointers to null cells into the transmit ring.

These and other features and advantages of the present invention willbecome more apparent from the accompanying drawings and the followingdetailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an exemplary processing system inaccordance with the present invention.

FIGS. 2A-2D illustrate different graphics processing modes which may beimplemented in the processing system of FIG. 1.

FIG. 3A is a block diagram of an exemplary graphics prescaler inaccordance with the invention and suitable for use in the processingsystem of FIG. 1.

FIG. 3B is a flow diagram illustrating the operation of the exemplarygraphics prescaler of FIG. 3A.

FIG. 4A illustrates an exemplary 256×16 color look-up table (CLUT)divided into sixteen separate pallets and suitable for use in a dynamicCLUT alteration technique which may be implemented in the processingsystem of FIG. 1.

FIG. 4B shows an input data stream and a corresponding converted datastream suitable for use with a dynamic CLUT alteration technique.

FIG. 4C is a schematic diagram of an exemplary circuit implementation ofa dynamic CLUT alteration technique.

FIG. 4D is a flow diagram illustrating an exemplary dynamic CLUTalteration technique.

FIG. 5A is a schematic diagram illustrating an exemplary synchronousphase detector in accordance with the present invention and suitable foruse in the processing system of FIG. 1.

FIG. 5B is a timing diagram illustrating the operation of the clockenable circuit of FIG. 5A.

FIG. 6A is a block diagram illustrating a data transfer pipelineutilizing a clock enable signal generated in the synchronous phasedetector of FIG. 5A.

FIG. 6B is a timing diagram illustrating the operation of the datatransfer pipeline of FIG. 6A.

FIG. 7A shows the correspondence between bytes and pels in an exemplaryvideo data stream to be encoded in accordance with a differentialencoding technique of the present invention.

FIG. 7B is a flow diagram illustrating a video date encoding techniquein accordance with the invention.

FIGS. 8A and 8B are block diagrams illustrating an exemplary videoprocessing system in which a single-buffered display capture techniquemay be implemented in accordance with the invention.

FIG. 9A shows an exemplary register configured to provide ahardware-based drawing acceleration engine sharing function inaccordance with the present invention.

FIG. 9B is a flow diagram illustrating the operation of an exemplarysharing function using the register of FIG. 9A.

FIG. 10 is a block diagram illustrating an exemplary system suitable forimplementing asynchronous transfer mode (ATM) segmentation andreassembly (SAR) functions in accordance with the invention.

FIG. 11A is a block diagram of an exemplary SAR receiver in accordancewith the present invention.

FIG. 11B is a flow diagram illustrating the input filtering and storagefunctions performed in an ATM reassembly operation.

FIG. 11C shows an exemplary receive ring portion of memory suitable foruse in an ATM reassembly operation.

FIG. 11D is a flow diagram illustrating the cyclic redundancy code (CRC)calculation and AAL5 framing functions of an ATM reassembly operation.

FIGS. 12A-12H illustrate an exemplary ATM reassembly operation inaccordance with the present invention.

FIG. 13 is a block diagram of a CRC processor suitable for use in ATMsegmentation and reassembly operations.

FIG. 14A is a block diagram of an exemplary SAR transmitter inaccordance with the invention.

FIG. 14B is a flow diagram illustrating a portion of an exemplarysegmentation operation in accordance with the invention.

DETAILED DESCRIPTION OF THE INVENTION

The present invention will be described in a number of differentsections as set forth in the following brief outline.

    ______________________________________    1.       Set Top Box Processing System    2.       Graphics Processor             2.1  Square Pixel Aspect Ratio             2.2  Graphics Modes             2.3  Alpha Prescaler             2.4  Dynamic Color Look-up Table (CLUT)    3.       Clock Circuitry             3.1  Synchronous Phase Detector             3.2  Multiple Clock Pipeline Structure    4.       Video Data Encoding    5.       Single-Buffered Display Capture    6.       Register-Based Process Sharing    7.       Memory Arbitration    8.       ATM Segmentation and Reassembly (SAR) Features             8.1  General Description             8.2  Reassembly             8.3  Segmentation    ______________________________________

Although illustrated herein in conjunction with exemplary set top boxprocessing applications, the present invention is more generallyapplicable to numerous other video, audio, graphics and/or communicationapplications. For example, the ATM SAR features of the present inventionmay be utilized in any application requiring an efficient interface toan ATM network, and the multiple clock enable circuit may be utilized inany application in which it is desirable for different portions of adevice or system to utilize one or more additional clocks which arenon-integer multiple versions of a first clock. The term "set top box"as used herein should therefore be construed broadly to include anyvideo, audio, graphics and/or communications processing device orsystem. Furthermore, although illustrated in conjunction with MPEG-2transport streams, the invention is more broadly applicable topacket-based data streams generated in accordance with standards otherthan MPEG-2. These other standards include, for example, the video andaudio portions of the CCITT H.320 standard, and the audio codingstandards of MPEG-1 and Dolby AC-3. The term "transport stream" as usedherein should therefore be understood to refer to any packet-baseddigital data stream which includes video, audio and/or other types ofdata, or various combinations thereof.

1. Set Top Box Processing System

FIG. 1 is a block diagram of an exemplary set top box processing system10 in accordance with the present invention. The processing system 10includes a network interface module (NIM) 12 which receives an inputsignal via a network port 14. The NIM 12 may serve as an interface to acable, telephone or computer network. For example, the input signal mayan RF signal supplied from a multichannel multipoint distributionservice (MMDS) to the processing system 10 at a remote user site usingconventional transmission techniques. Other exemplary signaldistribution techniques suitable for use with the present inventioninclude switched digital video (SDV), hybrid fiber/coax (HFC), directbroadcast satellite (DBS) and digital subscriber loop (DSL). The inputsignal is demodulated or otherwise processed in a physical layerinterface 16. Portions of the demodulated input signal are supplied froman output interface 18 to an ASIC processor 20 over data interface line22. An MPEG-2 transport stream portion of the demodulated input signalis applied over line 24 to the processor 20. The portions of thedemodulated input signal passing over lines 22 and 24 may be furtherprocessed by a digital video broadcast (DVB) descrambler 24 within theASIC 20. The DVB descrambler 24 could alternatively be arranged externalto the ASIC 20. The MPEG-2 transport stream representshierarchically-organized compressed video, audio and other program data,and is described in greater detail in A. Wasilewski, "MPEG-2 SystemsSpecification: Blueprint for Network Interoperability," Comm. Tech.,February 1994, which is incorporated by reference herein. The MPEG-2standard was developed by the International Standards Organization (ISO)Moving Picture Experts Group (MPEG) and is documented in ISO/IEC DIS13818, which is incorporated by reference herein. Other portions of thedemodulated input signal, as well as control signals for the NIM 12, maybe supplied over a bus 28 connected to the interface 18. The bus 28 isalso connected to the ASIC processor 20.

A central processing unit (CPU) 30 is connected to bus 28, and may beimplemented as a Motorola MC68306 processor operating at 16 MHz. Manyalternative CPUs are suitable for use in processing system 10,including, for example, other CPUs in the MC68xxx series, as well asCPUs in the PowerPC 40x series. Also connected to bus 28 is a Flashread-only memory (ROM) 36 which may have a memory capacity on the orderof 512 Kbytes. Other elements which may be connected to bus 28 but arenot shown in FIG. 1 include a modem and an optional SIMM socket forexpansion of dynamic random access memory (DRAM). The modem may be usedto communicate with external telephone, computer or cable networkcommunication channels. The ASIC processor 20 includes a CPU interface32 through which the processor 20 and other elements connected theretocommunicate with the CPU 30. The processing system 10 further includes aDRAM 40 which communicates via bus 28 with the ASIC processor 20. TheDRAM 40 may have a memory capacity on the order of 512 Kbytes, althoughit should be noted that the capacity of DRAM 40, Flash ROM 36 and othermemory devices in processing system may vary depending upon the memoryrequirements of a given application. As will be described in greaterdetail below, the DRAM 40 is generally used to support CPU operations,as well as the video, graphics and ATM communication processingfunctions of the processor 20. The processor 20 includes a DRAMcontroller 42 which may control some or all of the DRAM 40 using controlsignals supplied via line 44. The processor 20 also includes an MPEG-2demux 50 which receives an MPEG-2 transport stream from the NIM outputinterface 18 via line 26 and generates therefrom one or more MPEG-2elementary data streams.

The MPEG-2 transport stream supplied via line 24 will now be describedin more detain. A given transport stream associates related elementarydata streams for a given program or programs such that the elementarystreams can be extracted, decoded and presented together in a coherentfashion. Each elementary data stream represents a stream of MPEG-2encoded audio, video or other data. An MPEG-2 transport stream generallyincludes a sequence of fixed-length 188-byte transport packets. Atransport packet of the PES-bearing type includes a payload whichcarries a portion of a longer packetized elementary stream (PES) packet,where a PES packet includes elementary stream data for a given programas well as corresponding timing, identification and control information.All PES-bearing transport packets with a common packet identifier (PID)carry elementary stream data for a single common elementary stream andno other. The payload portion of the transport packet will thus includeelementary stream data from a corresponding PES packet if the transportpacket is of the PES-bearing type. The transport packet may also be ofthe program specific information (PSI) type or the private data type.

Each transport packet also includes a one-byte sync pattern and athree-byte prefix, and may include a variable-length adaptation field.The adaptation field may include, for example, program clock reference(PCR) and encryption key management information. The sync byte is afixed pattern which permits identification of the beginning of eachtransport packet, and is 47×H in the MPEG-2 standard. The prefixincludes a thirteen-bit packet identifier PID which, as noted above,identifies the elementary stream supplying the transport packet payload.The transport packet prefix also includes two adaptation field controlbits which indicate whether the corresponding transport packet includesa payload with no adaptation field, an adaptation field with no payload,or both an adaptation field and a payload. The prefix further includes apacket error indicator bit, a payload unit start indicator bit, atransport priority bit, two transport scrambling control bits and afour-bit continuity counter. Additional detail regarding MPEG-2transport packets may be found in the above-cited ISO reference.

The MPEG-2 demux 50 may provide a number of additional functions,including video and audio decoder control, PSI table parsing, PCR clockrecovery, and private data capture which supports multiple simultaneousPIDs. It should be noted that the MPEG-2 demux 50 may be configured inthe manner described in U.S. patent application Ser. No. 08/585,109entitled "Transport Stream Decoder/Demultiplexer for HierarchicallyOrganized Audio-Video Streams," which is assigned to the assignee of thepresent invention and incorporated by reference herein. Although notillustrated in FIG. 1, transport stream recording and playback featuresmay be provided in processing system 10 in the manner described in U.S.Patent application Ser. No. 08/566,283 entitled "Recording and Playbackof Audio-Video Transport Streams", now abandoned, which is assigned tothe present assignee and incorporated by reference herein.

Elementary video streams from the MPEG-2 demux 50 are supplied to anMPEG-2 video decoder 52, while elementary audio streams from the demux50 are supplied to an MPEG-2 audio decoder 54. The processor 20 maymanage small ring buffers in DRAM 40 for each of the elementary streams.The decoders 52, 54 convert the elementary streams into decoded videoand audio data signals, respectively, using conventional techniques. Thevideo decoder 52 utilizes a DRAM 56 to perform MPEG-2 video decodingoperations, and may be configured to support fullmain-profile-at-main-level (MP@ML) MPEG-2 decoding as defined by theabove-cited ISO/IEC 13818-2 specification. The memory capacity of theDRAM 56 may be on the order of 2 Mbytes. The decoded video signal fromdecoder 52 is supplied to a graphics processor 60 in the ASIC processor20 and utilized in graphics overlay operations to be described ingreater detail below. The graphics processor 60 in processor 20 combinesthe decoded video signal with one or more graphics signals and suppliesa combined digital video output signal to an NTSC encoder 64 via line65. The NTSC encoder 64 converts the digital video signal to an analogvideo signal suitable for display on a television or other displaymonitor connected to a composite video output 67.

The MPEG-2 audio decoder 54 may be configured to support the MusicamAudio Layer II defined by the ISO/IEC 11172-3 specification, includingall single and dual channel modes. Multiple sample rates such as 32 KHz,44.1 KHz and 48 KHz may be supported. The decoded audio signal fromdecoder 54 is supplied to a pulse-code modulation (PCM) audio processor62 in the processor 20. The PCM audio processor 62 in processor 20combines the decoded audio signal with one or more PCM audio signals andsupplies a combined digital audio signal to an audio digital-to-analogconverter (DAC) 68 via line 69. The audio DAC 68 converts the combineddigital audio signal into an analog audio signal which may be suppliedto a speaker or other audio output device connected to stereo output 70.The PCM audio feature allows uncompressed PCM audio to be mixed withdecoded MPEG audio so that it is possible to, for example, play soundeffects while decoding an MPEG program. The analog video and audiooutput signals are also supplied directly to an RF modulator 72 whichmay be configured to modulate the analog video and/or audio onto one ormore RF carrier signals suitable for application to an RF input of atelevision, video cassette recorder (VCR) or other device connected toRF output 74. An RF bypass input 76 is connected to the RF modulator 72and is used, for example, to allow an input analog video signal fromanother source to be supplied directly to a television monitor.

The processing system 10 includes a smartcard interface 80 connected tothe processor 20. The smartcard interface includes a smartcard socketfor receiving a smartcard. The smartcard socket may be configured inaccordance with the ISO 7816 standard, which is incorporated byreference herein, and may utilize a smartcard of the type known asNagraVision™ available from Nagra+ of Switzerland. Numerous alternativesmartcards are well known in the art and may also be used. The smartcardinterface 80 and corresponding smartcard may be part of a conditionalaccess service (CAS) compliant with ISO/IEC 13818-1, ISO 7816 and theDigital Video Broadcast (DVB) recommendations. The CAS system utilizesthe MPEG-2 demux 50 in processor 20 to identify entitlement managementmessages (EMMS) and entitlement control messages (ECMs) in an incomingMPEG-2 transport stream. The EMMs are typically addressed to thedecoders 52, 54 and indicate whether the decoders are entitled toreceive program data transmitted on a given input signal channel orchannels. The EMMs may also be used to specify an entitlement timerange, or event signaling information such as near video on demand(NVOD)/pay-per-view (PPV) billing credits, return channel accessschedules, parental control information or custom application-definedevents. A given EMM may contain an encrypted service key which is usedto decrypt subsequent ECMs. The service keys are changed at a relativelylow rate, typically on the order of days or months. The ECMs areaddressed to the decoders 52, 54 and contain encrypted control words(CWs) which are changed at a relatively frequent rate, typically on theorder of seconds. The EMMs and ECMs identified in demux 50 are queued byprocessor 20 in DRAM 40 for transmission through the smartcard interface80 to the smartcard. A direct memory access (DMA) technique may be usedto implement this transfer. The smartcard stores a secret key for theprocessing system 10 and uses the secret key to decrypt an encryptedservice key and thereby authenticate the EMM information. The decryptedservice key is then used to decrypt the encrypted CWs which are suppliedto the DVB descrambler 26 for use in decoding portions of an entitledprogram. Any event EMMs may be transferred to an event queue forprocessing by the CPU 30.

The processing system 10 includes an infrared (IR) receiver 82 whichreceives a control signal from a remote control device in a conventionalmanner. The system 10 is also configured to include an IR transmitter 85which supplies an output IR signal to an IR output 86. The output IRsignal may be used to control the operation of or otherwise communicateinformation to other devices within the vicinity of the processingsystem 10. For example, the IR transmitter 85 may be used to communicatewith a VCR in conjunction with an electronic programming guide tofacilitate VCR programming.

An interface to an asynchronous transfer mode (ATM) communicationnetwork is provided in system 10 using an ATM segmentation andreassembly (SAR) device 90 contained within processor 20. The operationof the SAR device 90 will be described in greater detail below. The ATMSAR device 90 may interface directly with a UTOPIA port for connectionto an ATM network via a physical layer (PHY) device such as asynchronous optical network (SONET) interface. The term UTOPIA refers toa standard handshake/data transfer protocol defined by the ATM Forum forcommunication between an ATM layer device, such as an ATM SAR device,and a physical layer device, such as a SONET interface. The UTOPIA portmay be included within the processor 20 or elsewhere in the processingsystem 10. Alternative protocols could also be used to interfaceprocessor 20 with an ATM network. The ATM SAR capability facilitatesimplementation of the processing system 10 in applications based onswitched digital video (SDV) architectures. As will be described ingreater detail below, an ATM SAR device in accordance with the presentinvention alleviates processing bottlenecks by utilizing a shared memoryapproach and an appropriate allocation of hardware and softwareresponsibility for ATM processing operations.

It should be noted that many of the elements of processing system 10which are shown outside the ASIC processor 20 may in alternativeembodiments be incorporated into the processor 20. For example, onepossible alternative arrangement could incorporate the video decoder 52,the audio decoder 54 and the NTSC encoder 64 into the ASIC processor 20.Of course, numerous other alternative arrangements of the illustratedelements may also be utilized.

2. Graphics Processor

The set top box processor 20 includes a graphics processor 60 which canbe configured to support a variety of graphics modes and resolutions. Anexemplary embodiment may support a background plane, a decoded videoplane, a graphics plane and a hardware cursor. The graphics plane may bearranged to support multiple resolutions of pixel size and aspect ratio,including square pixels, multiple color modes, and multiple levels ofalpha blending. The graphics plane may be programmable in size, screenposition, and DRAM memory map position. The graphics plane will also bereferred to herein as the drawport. On a case in which the drawport isconfigured to be smaller than an entire display screen, the area outsidethe drawport may be set to the background color or can be made"transparent" to allow video to show through. Suitable variation offactors such as resolution, color depth and drawport size may be used tocontrol the amount of DRAM 40 which is used by the graphics processor60. The present invention provides a number of graphics modes whichrequire less memory and therefore free up large portions of memory foruse in other processing applications.

2.1 Square Pixel Aspect Ratio

As noted above, the graphics processor 60 may be configured to support asquare pixel aspect ratio, that is, a 1:1 aspect ratio. The MPEG-2 videodecoder 52 and NTSC encoder 64 of FIG. 1 typically utilize a 4:2:2chrominance format which results in a 9:8 aspect ratio. Although thedifference between a 9:8 and 1:1 aspect usually does not result incompletely unacceptable appearance, it still may be desirable to utilizea 1:1 ratio rather than a 9:8 ratio when, for example, displayinggraphics content which was prepared for a square pixel platform.Conversion of a 9:8 aspect ratio to a 1:1 aspect ratio will generallyinvolve at least some amount of re-sampling of a given image to stretchor shrink one of the dimensions. It should be noted that re-samplingwill usually cause some loss of image bandwidth and therefore fidelity.It may thus be preferable to use the 9:8 video aspect ratio unless theapplication has a specific need for a square pixel aspect ratio.

In accordance with the invention, a horizontal re-sampling filter can beincluded within the ASIC processor 20 of FIG. 1. The re-sampling filtermay be part of the graphics processor 60, and can be enabled or disabledunder control of the CPU 30. The re-sampling filter provides a squarepixel aspect ratio by stretching the image horizontally. It has beendetermined that this horizontal stretching is significantly more costeffective than vertical shrinking. One reason that vertical shrinking ismore expensive is that vertical filters typically require line buffersand utilize substantially more memory bandwidth.

2.2 Graphics Modes

The graphics processor 60 can support multiple transparency modes whicheach provide several different levels of blending between graphics andunderlying video. In one embodiment, transparency modes are providedwhich support nine different levels of blending. A first transparencymode, referred to as a chroma key mode, allows a particularred-green-blue (RGB) color to be specified as translating totransparent. When the color designator appears in a given pixel or groupof pixels in an image to be displayed, the underlying video plane ismade visible. This chroma key translation can be utilized in either adirect RGB mode, in which an RGB color designator is supplied directlyfrom memory, or a color look-up table (CLUT) mode, in which an indexsupplied from memory is used to specify a color designator in the CLUT.Other transparency modes, to be described in detail below, include a5-5-5-1 RGBA mode and a 4-4-4-4 RGBA mode. These RGBA modes may beimplemented as either direct RGB or CLUT modes.

FIG. 2A illustrates a direct 5-5-5-1 RGBA mode supported by graphicsprocessor 60. A 16-bit RGB color designator for a given pixel issupplied from memory 40 to the graphics processor 60. The 16-bitdesignator includes 5 bits each of R, G and B and a one-bit alpha (A)value which specifies one of two transparency classes. The 15 RGB bitsare supplied to an RGB to YUV converter 102 which converts a sequence of15-bit RGB values to 8-bit luminance (Y) and chrominance (UV) pixels inaccordance with a conventional 4:2:2 chrominance format in which everyblock of four luminance pixels also includes two chrominance pixels. TheA bit is supplied to an alpha look-up table (ALUT) 104 which in thisembodiment is configured as a 2×4 LUT in which the A bit identifies oneof two 4-bit alpha blending registers. Each blending register in thisexample contains one of nine 4-bit blending values, 0/8, 1/8, 2/8, 3/8 .. . 8/8. The blending value specifies the transparency of the overlyinggraphics relative to the video, and is supplied to one input of a mixer106. Other inputs of the mixer 106 receive the converted YUV output in4:2:2 format from RGB to YUV converter 102, and the decoded MPEG videoinput in 4:2:2 format from the video decoder 52. The mixer 106 utilizesthe blending value and the 4:2:2 video and graphics signals to form acombined video and graphics signal which is supplied to the NTSC encoder64 as shown in FIG. 1.

FIG. 2B illustrates a direct 4-4-4-4 RGBA mode supported by graphicsprocessor 60. As in the direct 5-5-5-1 mode, a 16-bit RGB colordesignator is supplied from memory 40 to the graphics processor 60.However, the 16-bit designator in the direct 4-4-4-4 mode includes only4 bits each of R, G and B and a 4-bit alpha (A) value which directlyspecifies one of the above-noted nine possible blending values. The4-bit alpha value utilizes a least significant bit from each of the R, Gand B color values. The direct 4-4-4-4 mode thus sacrifices the leastsignificant bit of each of the R, G and B color values to provide a4-bit transparency weight for each pixel. The 12 RGB bits are suppliedto an RGB to YUV converter 102 which converts the 12-bit RGB values to a4:2:2 pixel format. The 4-bit blending value is supplied directly to themixer 106, which uses the value and the 4:2:2 video and graphics signalsto generate a combined video and graphics signal as in the 5-5-5-1 modedescribed above.

FIGS. 2C and 2D illustrate the operation of the 5-5-5-1 and 4-4-4-4transparency modes using a 256×16 color look-up table (CLUT) 110. In thetransparency modes based on the CLUT, the 16-bit RGBA value is suppliedfrom the CLUT 110 rather than directly from memory 40. An 8-bit index tothe CLUT 110 is supplied from the memory 110 and used to determine a16-bit RGBA value for a given pixel. Once the 16-bit RGBA value isdetermined using the CLUT 110, the operation of the CLUT-based 5-5-5-1and 4-4-4-4 transparency modes is the same as that of the direct 5-5-5-1and 4-4-4-4 modes previously described in conjunction with FIGS. 2A and2B. The transparency modes of the present invention thus operate insubstantially the same manner regardless of whether the 16-bit value fora given pixel comes directly from memory 40 or is supplied indirectlyvia the CLUT 110. In other words, the CLUT table entries are formattedin the same manner as direct memory mapped pixels. The CLUT may beimplemented in a number of alternative sizes, depending upon theapplication. The convention "CLUTx" will be used to denote a CLUT havingan x-bit index and therefore 2^(x) entries. The exemplary 256×16 CLUT110 of FIGS. 2C and 2D utilizes an 8-bit index to address each of the256 entries, and is therefore referred to herein as a CLUT8 type ofCLUT.

Color expansion features may be provided to further improve processingspeed in certain applications. Many graphics operations involve fillinga pattern with just one or at most two different colors. Examples ofsuch operations include region fills and text instantiation. The director CLUT-based RGBA modes described above may therefore often involvewriting 8 or 16 bits per pixel, respectively, but with the same colorover and over again. The graphics processor 60 may therefore beconfigured to allow a graphics driver such as CPU 30 to set a draw colorjust once in a register in graphics processor 60, and then to draw up to16 pixels per write cycle to the graphics processor 60 by writing a maskwith one bit per pixel significance. For an MC68306 CPU, this colorexpansion feature can result in about a factor of ten speed improvementfor region fill operations.

In an exemplary implementation, a color expander is provided whichincludes four registers, a foreground/background color register, a maskregister, a data register and a destination pointer register. The colorexpander facilitates the transfer of 1 bit/pixel font/icon bitmaps to an8-bit per pixel display. The expansion process is initiated by a writeto the data register. Each bit in the mask and data registers maps to abyte in DRAM. The corresponding destination DRAM byte is modified if themask bit is a logic one and not modified if the mask bit is a logiczero. The modification, if any, is dependent on the value of the dataregister bit. For example, the DRAM byte may be set to the foregroundcolor if the data bit is a logic one and set to a background color ifthe data bit is a logic zero. The mask register may be initialized bydefault to all ones, such that the default will be to write theforeground color wherever the data is a one and the background colorwherever the data is a zero. This will provide a basic opaque colorexpansion suitable for use with two-color text, stipples and blockfills. A transparent or masked opaque stipple can be provided by writingthe mask register before the data register.

2.3 Alpha Prescaler

In the exemplary graphics modes described in conjunction with FIGS.2A-2D, the output of the RGB to YUV converter 102 was applied directlyto the mixer 106 and mixed therein with the decoded video signal inaccordance with the specified alpha blending value. Alternativeembodiments of the invention may utilize an alpha prescaler to scale theYUV graphics signal before it is combined with the decoded video inmixer 106. The alpha prescaling serves to preserve the properrelationship between graphics and video in the event certain processingfunctions such as horizontal and/or chroma filtering are performed onthe graphics pixels prior to blending with the video pixels.

FIG. 3A shows an exemplary implementation of a graphics processingcircuit which includes an alpha prescaler 112 arranged between theconverter 102 and the mixer 106. As noted above, the converter 102converts RGB pixels to 8-bit luminance (Y) and chrominance (U,V) pixelswhich are compatible with the 4:2:2 format of the decoded MPEG video.The converted YUV signal is applied to the alpha prescaler 112 whichmultiplies the YUV signal by the quantity 1-α₀ in which the value α₀represents an initial unscaled alpha blending value specified for agiven pixel in the manner described in conjunction with FIGS. 2A-2Dabove. For example, the value α₀ may represent one of the nine blendingvalues 0/8 through 8/8 in the examples described above. The prescaledYUV signal is then applied to the mixer 106 along with the initial alphablending value. The mixer 106 in this embodiment includes aninterpolator 114, a signal combiner 116 and a multiplier 118. Theinterpolator 114 performs a horizontal filtering operation on theprescaled YUV signal and the initial alpha blending value to therebygenerate an interpolated scaled YUV signal,

     (1-α.sub.0)YUV!.sub.i,

which is applied to the signal combiner 116, and an interpolatedblending value α_(i) which is applied to the multiplier 118. Theinterpolator may also perform a chroma filtering function to convert8-8-8 YUV data into the 4:2:2 chrominance format of the decoded MPEGvideo. This chroma filtering may be provided using a three-tap chromafilter with coefficients (1/4, 1/2, 1/4). The interpolated blendingvalue scales the decoded video signal in multiplier 118 and the resultis combined with the interpolated scaled YUV signal in the signalcombiner 116. The output of the signal combiner 116 represents acombined video and graphics signal,

    α.sub.i V+ (1-α.sub.0)YUV!.sub.i,

which may be supplied to the NTSC encoder 64 as shown in FIG. 1.Although the interpolator 114 is shown as part of the mixer 106 in thisexample, the interpolator 114 may be arranged outside of the mixer inother embodiments. Also, the interpolator 114 may provide numerousalternative types of known functions, in place of or in addition to thehorizontal and chroma filtering functions noted above. Other possibleinterpolation functions suitable for use with the present invention inplace of or in additional to the above-described horizontal and/orchroma filtering include, for example, linear or non-linear filters forsmoothing, sharpening or noise reduction.

The operation of the graphics processing circuit of FIG. 3A isillustrated in the flow diagram of FIG. 3B for a direct 5-5-5-1 RGBAmode. In step 150, an RGBA pixel is received including 5 bits each of R,G and B data and one alpha bit A. Step 152 indicates that the alpha bitA is used to select one of two 4-bit fields in a graphics mode registerin processor 20. Each 4-bit field specifies a particular alpha blendingvalue α₀. In the above-described examples, one of nine possible blendingvalues α₀ was specified in the 4-bit field. Step 154 indicates that the5-5-5 RGB values are converted in converter 102 into 8-8-8 YUV data, andthe YUV data is scaled by a factor of 1-α₀ in alpha prescaler 112. Theresultant scaled values are then interpolated by horizontal filtering ininterpolator 114, as shown in step 156. As noted above, theinterpolation operation may also include chroma filtering to convert the8-8-8 YUV data into a 4:2:2 chrominance format to match the decodedvideo format. The decoded video is then multiplied by the interpolatedalpha blending value α_(i) and combined with the interpolated prescaled(1-α₀)YUV!_(i) signal, as shown in step 158.

The alpha prescaling operation should generally be performed prior tointerpolation operations such as horizontal filtering, as is illustratedin the following example. Assume an RGB data sequence includes twopixels, the first a red pixel with an alpha value of zero (allgraphics), and the second a green pixel with an alpha value of one (allvideo). Assume also that green is the designated transparent color inaccordance with the above-described chroma key technique, such that whena green pixel is received, only the underlying video should bedisplayed. Further assume that the two pixels are horizontally adjacentpixels which are to be averaged in interpolator 114 using a simpletwo-tap averaging filter with coefficients (1/2, 1/2). If the two pixelsare applied directly to the horizontal filter before applying theabove-described alpha prescaling, the resulting output pixel willinclude 50% red from the first pixel as well as 50% green from thesecond pixel when no green should be visible. However, if the two pixelsare first prescaled by the quantity 1-α₀, where α₀ is the above-notedalpha value of zero for the red pixel and one for the green pixel, theresulting output pixel will include 50% red and no green. Assuming theinterpolator 114 also performs horizontal filtering on the pixel alphavalues as is shown in FIG. 3A, the interpolated alpha value α_(i) forthe resulting output pixel will be (1/2(0.0)+1/2(1.0)) or 0.5. Theinterpolated alpha value α_(i) is then used to blend in decoded videowith the output graphics pixel. The blending produces the desired outputwith a graphics pixel having 50% red and no green, and 50% underlyingvideo. As noted previously, performing the alpha prescaling operation ofthe present invention prior to the horizontal filtering would have hadthe undesirable result of allowing some portion of the green pixel topass to the output.

The graphics processor 60 may be configured to provide an analog overlaymode of operation suitable for use with analog mixers. The analogoverlay mode involves scaling the alpha blending values from, forexample, the nine possible blending values used in the foregoingillustrative embodiment, to a reduced number of values such as 0.0, 0.5and 1.0. This reduction in the number of possible alpha values willgenerally help to reduce the potential for downstream error. Theoriginal alpha values may therefore be quantized to one of the threereduced levels, and then converted to mix bits suitable for driving ananalog mixer. The graphics YUV should generally be unscaled by alpha ifthe analog mixer cannot accommodate the scaled YUV data.

2.4 Dynamic Color Look-up Table (CLUT)

The graphics processor 20 may include another graphics mode referred toherein as a dynamic color look-up table (CLUT). An exemplary embodimentwill be described in conjunction with FIGS. 4A-4D. FIG. 4A shows a CLUT110 which may be implemented in the graphics processor 60. The CLUT 110is a 256×16 CLUT with 256 16-bit RGBA entries. As described above inconjunction with FIGS. 2C and 2D, the CLUT 110 may be addressed using an8-bit index. The dynamic CLUT mode of the present invention allows theCLUT 110 to be addressed using only a 4-bit index, and is therefore alsoreferred to herein as a CLUT4 mode. In the CLUT4 mode, the CLUT 110 isviewed as including 16 different color pallets P0 through P15 as shownin FIG. 4A. Each of the color pallets P0-P15 includes sixteen 16-bitRGBA entries. A 4-bit index can therefore be used to identify one of thecolor pallets P0-P15 or one of the sixteen entries within a givenpallet.

FIG. 4B illustrates an input data stream S1 which includes a series of4-bit color indicators and a modified data stream S2 in which the 4-bitcolor values are converted to 8-bit indicators in accordance with thepresent invention. The series of 4-bit indicators in the input stream S1generally serve as a 4-bit address identifying one of the sixteenentries in a particular pallet P0-P15. For example, the indicator "3"refers to word three, or the fourth entry, of an identified pallet. Theparticular pallet addressed by a 4-bit indicator is determined by apallet identifier which immediately follows a key value in the inputstream. In this example, the 4-bit input stream key value is 1111 or"F". For the first two indicators in stream S1, the pallet identifierhas been previously set to P0. Therefore, the first two indicators "3"and "4" of S1 are converted to 8-bit indicators by appending them to thepallet identifier. The resulting 8-bit indicators are shown incorresponding portions of the stream S2 as "03" and "04". The 8-bitindicators are thus formed from the 4-bit indicators using a designatedpallet identifier in conjunction with the 4-bit values.

The same pallet identifier is used for all 4-bit indicators in the inputdata stream S1 until the above-noted key value appears in the stream.When the key value "F" appears in the input stream, the graphicsprocessor 60 is notified that the pallet identifier is about to bechanged, and that the next 4-bit value in the input stream S1 willspecify a new pallet identifier to be used with subsequent 4-bitindicators. The key value "F" appears as the third value in the inputstream S1 in the example of FIG. 4B. The corresponding converted 8-bitindicator in the converted stream S2 is "0F" and identifies a backgroundcolor. The 4-bit indicator following the key value "F" in stream S1 is"3" and indicates to the graphics processor 60 that the palletidentifier should be changed to "3" to identify pallet P3. Thesubsequent 4-bit value in the input stream S1 is "4" and this value isconverted to an 8-bit indicator in stream S2 by appending it to the newpallet identifier "3". The resulting 8-bit indicator is "34" as shown inFIG. 4B and identifies word four, or the fifth entry, of pallet P3. Thisdynamic addressing technique permits the entire 256×16 CLUT 110 to beaccessed using 4-bit input data stream values.

FIG. 4C shows an exemplary graphics processing circuit 200 which may beused to implement the above-described dynamic CLUT feature of thepresent invention. The circuit 200 may be implemented within thegraphics processor 20 or elsewhere within ASIC processor 20 orprocessing system 10 of FIG. 1. An input data stream including y-bitblocks is received on an input 202 of circuit 200 and applied to amultiplexer 204. The y-bit output of multiplexer 204 is fed back to aregister 206. A given y-bit input block is compared in comparator 208with a key value n. The presence of the key value n in the input streamindicates that the pallet identifier should be changed to the valueimmediately following the key value in the input data stream. A giveny-bit block in the input data stream therefore may also be applied tothe register 212 which stores the current pallet identifier. Once apallet identifier has been stored in register 212, that identifier ispassed via line 214 to a 2^(2y) xm CLUT 220 and used as the upper y bitsof a 2y-bit address into the CLUT 220. This pallet identifier is usedwith each subsequent y-bit input block until the key value is received.The y-bit input blocks are passed via line 216 to the CLUT 220 and usedas the lower y bits of the 2y-bit address into the CLUT 220. The CLUT220 uses the y-bit input blocks and stored y-bit pallet identifier toselect one of 2^(2y) m-bit entries for output.

If the comparator 208 indicates a match between key value n and an inputdata stream block, the comparator output transitions from a low to ahigh level, is delayed through a register 210 and is then used to loadthe next input block into the register 212 as the new pallet identifier.The delayed comparator output is also used to disable the comparator 208until after the next input block has been received. Disabling thecomparator 208 in this manner ensures that an input block received aftera key value cannot itself be considered a key value. The delayedcomparator output is further applied as a select signal to themultiplexer 204. In the event of a match between a given input block andthe key value n, the next block in the stream is not used as an indexinto the current pallet. Instead, the previous block stored in register206 is used again by selecting the lower input of multiplexer 204. Oncethe new pallet identifier has been established and stored in register212, the comparator output has transitioned back to a low level, suchthat the comparator is again enabled, and the upper input of multiplexer204 is selected to thereby pass the y-bit input blocks to the CLUT 220.

FIG. 4D is a flow diagram which summarizes the operation of theexemplary circuit 200. In step 230, a given y-bit block of input streamdata is received on input 202 of circuit 200. The received y-bit blockis compared with key value n in comparator 208 as shown in steps 232 and234. If there is no match, step 236 indicates that the y-bit block isused as the lower y bits of a pallet look-up address. These lower y bitsare supplied to CLUT 220 via the upper input of multiplexer 204 and line216. If there is a match, step 238 indicates that the pallet identifierstored in register 212 is changed to the next y-bit value in the inputdata stream, and used as the pallet identifier for subsequent look-up inCLUT 220. It should be emphasized that the circuit 200 is merely anillustrative embodiment of the dynamic CLUT technique of the presentinvention, and that numerous alternative implementations will beapparent to those skilled in the art.

3. Clock Circuitry

The present invention provides clock circuitry which allows differentelements in the set top box processing system 10 to operate withdifferent but related system clocks. For example, the video datasupplied from the MPEG-2 video decoder 52 to the ASIC processor 20 inthe processing system 10 of FIG. 1 may be clocked by a first clock witha clock rate R1. The ASIC processor 20 may operate using a second clockwith a clock rate R2, where R2 is a multiple of R1. The NTSC encoder 64which receives the combined video/graphics output signal from the ASICprocessor 20 may also operate with the first clock at rate R1. In onepossible embodiment, the first clock may have a rate R1 of 27 MHz, whilethe second clock has a rate R2 of 1.5R1 or 40.5 MHz. Such non-integervariation in operating clock rates between different system elements haspresented a number of problems in prior art processing systems,including metastability and difficulty in regulating pipelined datatransfer. As a result, it has generally been necessary to utilize eithera common or integer-related multiple clock for all elements of theprocessing system, or to provide complex regulation mechanisms designedto avoid metastability and to regulate data transfer. The presentinvention avoids these and other problems of prior art processingsystems by utilizing a synchronous phase detector illustrated in FIG. 5Ain conjunction with a multiplexed pipeline structure illustrated in FIG.6A.

3.1 Synchronous Phase Detector

FIG. 5A is a schematic diagram of a synchronous phase detector 250 inaccordance with the invention. The phase detector 250 provides an enablesignal which may be used in a pipeline data transfer structure or anyother state-based logic circuit to permit different elements of theprocessing system 10 to utilize first and second clocks which arenon-integer multiples of one another. It will be assumed for thepurposes of this description that the first clock has a rate R1 of 27MHz and is utilized by the video decoder 52 and NTSC encoder 64. It willalso be assumed that the second clock has a rate 1.5 times that of thefirst clock, or 40.5 MHz, and is utilized by the ASIC processor 20. Itwill be appreciated by those skilled in the art that these exemplaryclock rates are selected for illustration purposes only, and that thedescribed synchronous phase detector is readily applicable to processingsystems utilizing more than two related clocks and/or other combinationsof clock rates.

The synchronous phase detector 250 includes a serial arrangement ofD-type flip-flops FF1-FF4 arranged as shown on FIG. 5A. The 27 MHz firstclock is applied via an inverter INV1 to a clock input of FF1. The 40.5MHz second clock is applied to a data input D1 of FF1 and to the clockinputs of FF2, FF3 and FF4. The uncomplemented outputs Q1 and Q3 of FF1and FF3 are applied to the data inputs D2 and D4 of FF2 and FF4,respectively. The complemented output of FF2 is applied to the datainput of FF3. The output enable signal ENB₋₋ 27 is provided at theuncomplemented output Q4 of FF4. As will be described in conjunctionwith FIGS. 6A and 6B below, this output may be utilized in a multiplexeddata transfer pipeline structure to prevent metastability and to provideeffective data transfer between processing system elements operating at27 MHz and elements operating at 40.5 MHz. Alternative embodiments ofthe synchronous phase detector 250 may eliminate the third and/or fourthflip-flops FF3 and FF4 and provide the enable signal ENB₋₋ 27 at thecomplemented output of FF2 or the uncomplemented output of FF3.

FIG. 5B is a timing diagram illustrating the manner in which the outputenable signal ENB₋₋ 27 is generated from the input 27 MHz and 40.5 MHzclock signals in the circuit 250. The first D-type flip-flop FF1 willclock on the falling edge of the 27 MHz clock signal shown in FIG. 5Bdue to the presence of the inverter INV1. At the first falling edge ofthe 27 MHz clock, the 40.5 MHz clock applied to the data input of FF1 islow, so the Q1 output of FF1 transitions from high to low. Q1 remainslow until the next falling edge of the 27 MHz clock, at which time the40.5 MHz clock is high, so Q1 transitions from low to high. This patternrepeats, such that Q1 has a period twice that of the 27 MHz signal. Thesecond flip-flop FF2 is clocked by the rising edge of the 40.5 MHzclock. At the first rising edge of the 40.5 MHz clock, the complementedQ2B output of FF2 transitions from high to low because the Q1 output ofFF1 is high. At the second rising edge of the 40.5 MHz clock, Q2Btransitions from low to high because Q1 is low. At the third rising edgeof the 40.5 MHz clock, Q1 is still low, so Q2B remains high. The nextrising edge of the 40.5 MHz clock causes Q2B to transition from high tolow, because Q1 has gone high. This pattern repeats to provide the Q2Bsignal as shown in FIG. 5B. As noted above, the Q2B signal itself may beused as an enable signal in accordance with the invention. In theexemplary embodiment of FIG. 5A, the Q2B signal is clocked through thetwo additional flip-flops FF3 and FF4. Each of the flip-flops FF3 andFF4 delay the Q2B signal by one period of the 40.5 MHz clock and therebyserve to align the rising edge of the output enable signal ENB₋₋ 27relative to the concurrent rising edges of the 40.5 MHz and 27 MHzclocks.

The synchronous phase detector 250 of FIG. 5A serves to extract thephase information in the 40.5 MHz and 27 MHz clocks such that thisinformation may be utilized to regulate data flow in a pipelinestructure or other state-based logic circuit in a manner to be describedbelow.

3.2 Multiple Clock Pipeline Structure

FIG. 6A shows a schematic diagram of an exemplary pipeline structure inaccordance with the present invention. FIG. 6B is a timing diagramillustrating the relationship between a 40.5 MHz clock, a 27 MHz clock,the above-described enable signal ENB₋₋ 27 and a number of other signalsused in the pipeline structure of FIG. 6B. In this exemplary embodiment,the pipeline structure is implemented within the graphics processor 60in the ASIC processor 20 of FIG. 1. The video decoder 52 operates at a27 MHz clock rate and supplies a video signal YUV27IN in a 4:2:2chrominance format at a rate of 27 MHz to a data input of a D-typeflip-flop 260 clocked at 27 MHz. FIG. 6B indicates that the video signalYUV27IN includes alternating luminance (Y) and chrominance (Cr, Cb)bytes as is described in greater detail in conjunction with FIG. 11Abelow. The uncomplemented output of flip-flop 260 is a delayed versionYUV27IN₋₋ D of the input signal YUV27IN and is applied to a first inputof a multiplexer 262. An output of multiplexer 262 is applied to a datainput of another D-type flip-flop 264 which is clocked at 40.5 MHz. Theoutput of the flip-flop 264 is a signal YUVIN shown in FIG. 6B. Thesignal YUVIN is applied to state-based logic 266 which in this exemplaryembodiment operates at the higher 40.5 MHz clock rate. The state-basedlogic 266 may represent a pipeline logic circuit, a state machine or anyother state-based circuitry. For example, the state-based logic 266 mayinclude a graphics overlay portion of the graphics processor 60. Thesignal YUVIN at the output of flip-flop 264 is also applied to a secondinput of the multiplexer 262. A select signal input of the multiplexer262 receives the above-described enable signal ENB₋₋ 27 generated by thesynchronous phase detector 250 of FIG. 5A. The enable signal inconjunction with the multiplexer 262 allows the 27 MHz input signalYUV27IN to be clocked into the state-based logic 266 in an acceptablemanner.

The output of the state-based logic 266 is applied to one input of amultiplexer 268 which also receives on a select signal input the enablesignal ENB₋₋ 27. The output of the multiplexer 268 is applied to a datainput of a D-type flip-flop 270 which is clocked at 40.5 MHz. The outputof the flip-flop 270 is a signal YUVOUT operating at a clock rate of40.5 MHz and shown in FIG. 6B. This signal is fed back to another inputof the multiplexer 268 and also applied to a data input of a D-typeflip-flop 272 which is clocked at 27 MHz. The output YUV27OUT from theflip-flop 272 is a 27 MHz combined video and graphics signal which isapplied to the NTSC encoder 64. The enable signal in conjunction withthe multiplexer 268 ensures that the 40.5 MHz signal supplied from thestate-based logic 266 of the graphics processor 60 can be accuratelyconverted to a 27 MHz signal suitable for application to the NTSCencoder 64.

The above-described pipeline structure uses an enable signal containingphase information from two clocks to permit the video decoder 52 andNTSC encoder 64 to operate at one clock rate while the graphicsprocessor operates a higher clock rate. The synchronous phase detectorof FIG. 5A and pipeline structure of FIG. 6A are particularlywell-suited for use in applications in which one processing systemelement operates at a rate R1 and a second operates at a rate R2, whereR1 and R2 are related in a non-integer manner such as R2=R1(2n+1)/2 forn=1, 2, . . . N. The above illustrative embodiment could be readilyadapted to accommodate other types of non-integer relationships. Itshould be emphasized that the pipeline data structure in FIG. 6A ismerely an illustrative embodiment of the invention, and that thedisclosed techniques could be applied to data transfer in a variety ofalternative types of state machines or other state-based logic.

4. Video Data Encoding

The present invention also provides a video data encoding techniquewhich reduces the amount of memory space required to store digitalvideo. The encoding technique is efficient and cost-effective, and canbe implemented using relatively simple hardware. The video data encodingaspects of the invention will be described using a CCIR-601 video datastream.

FIG. 7A shows a portion of a CCIR-601 encoded byte stream which includesa sequence of 8-bit bytes in which Y represents a one-byte luma sampleand Cb and Cr represent one-byte blue and red chroma samples,respectively. Although a luma sample and two chroma samples are requiredfor each pixel to be displayed, the odd luma in the byte stream do nothave associated chroma. FIG. 7A shows that each of the even pels 0, 2and 4 have a luma sample Y and two chroma samples Cr and Cb associatedtherewith, while the odd pels 1 and 3 have only a luma sample. Thechrominance information for the odd pels is recovered from the chromasamples of its surrounding pels using a suitable reconstruction filter.The CCIR-601 standard encodes luma samples Y using the range 10xH toEBxH, and encodes chroma samples Cr, Cb using the range 10xH to F0xH.The CCIR-601 encoded data may occasionally be allowed to exceed themaximum values in these specified ranges, but may never take on thevalues 00xH or FFxH, both of which are used for in-band signaling ofvideo timing information. It is apparent from FIG. 7A that the averagememory storage requirement for a stream of CCIR-601 encoded video datais 16 bits/pel. The present invention in an exemplary embodiment reducesthe storage requirement of the video data stream from 16 bits/pel downto only 8 bits/pel. This is accomplished by utilizing four encoding bitsrather than eight to encode each of the luma and chroma samples in thevideo data stream. The four encoding bits specify one of sixteendifferent codes, which are grouped into absolute codes and delta codes.The present invention achieves this substantial reduction in encodeddata through a selective utilization of the above-noted CCIR-601 codingranges.

A first exemplary embodiment of the video data encoding of the presentinvention utilizes fourteen of the 4-bit codes, 1xH to ExH, as absolutecodes which correspond to CCIR-601 codes 18xH to E8xH as shown in TABLE1 below:

                  TABLE 1    ______________________________________    Input Range      Code   Output    ______________________________________    10-1F            1      18    20-2F            2      28    30-3F            3      38    40-4F            4      48    50-5F            5      58    60-6F            6      68    70-7F            7      78    80-8F            8      88    90-9F            9      98    A0-AF            A      A8    BO-BF            B      B8    CO-CF            C      C8    DO-DF            D      D8    E0-EF            E      E8    ______________________________________

These absolute codes introduce a maximum encoding error of -8 to +7relative to the higher resolution CCIR-601 input codes. Since the inputdata values may occasionally exceed the 10xH to F0xH range, the input isfirst clipped to the 10xH to EFxH range. That is, all input data valuesless than 10xH become 10xH, and all values greater than EFxH becomeEFxH. The absolute codes can then be generated using only the four leastsignificant bits of the input data.

Additional precision is provided in accordance with the invention byusing the remaining two of the above-noted sixteen 4-bit codes as deltacodes. The first delta code 0xH specifies that the current encodedoutput value will be generated by adding four to the output value of thelast previously-coded component of the same type (Y, Cr or Cb). Thesecond delta code FxH specifies that the current encoded output valuewill be generated by subtracting four from the output value of the lastpreviously-coded component of the same type. These delta codes mayproduce an output value which is closer to the input value than thatwhich would be produced using the absolute code. This is particularlytrue for the many practical applications in which image date tends tochange slowly across a given scene. A video data encoder implementingthe above-described absolute and delta coding could be configured toselect a delta code if the resulting encoding error will be less than orequal to the encoding error of the absolute code.

Consistent encoding may be provided for a given image by using anabsolute code rather than a delta code for the first component of eachtype (Y, Cr, or Cb) on a given scan line. This process may beimplemented in a video encoder by resetting the last output value foreach type to 00xH at the beginning of each scanline. Since the closestvalid CCIR-601 input code is 10xH, the encoding error resulting fromusing a delta code will be at least +16, which is greater than themaximum encoding error resulting from use of an absolute code. Anabsolute code would therefore always be used for the first component ofeach type on a given scan line. Although the average encoding errorproduced by the absolute codes is on the order of four, the averageencoding error produced by the delta codes in a typical image is on theorder of two.

This exemplary embodiment of the encoding technique thus effectivelyprovides an extra two bits of encoding range for typical images.

FIG. 7B is a flow diagram illustrating the video data encoding process.In step 300, a luma or chroma component of the input video data streamis received in an encoder. The encoder in step 302 selects the absolutecode which produces an output value closest to the input value of thereceived component. A determination is made in step 304 as to whetherthe received component is the first of its type in a given scan line ofthe input video data stream. If the received component is the firstcomponent of its type on the scan line, step 306 indicates that theselected absolute code is used to encode the component, and the processthen returns to step 300 to receive the next component of the inputstream. If the received component is not the first component of its typeon the scan line, step 308 indicates that the encoder selects the deltacode producing an output value closest to the input value of thecomponent. The encoder in step 310 then compares the encoding errorwhich will result from the use of the selected absolute code and theselected delta code. The encoder then uses the code producing the lowestencoding error to encode the component. The process is repeated for eachreceived component in the input data sequence. The encoded data in theform of a sequence of absolute and delta codes may be stored in DRAM 40,processed in graphics processor 60, or otherwise utilized in theprocessing system 10 of FIG. 1.

The following example serves to illustrate the above-described videodata encoding process. All input values, absolute values, delta valuesand output values are in hexadecimal format.

    ______________________________________    Component: Cb Y Cr Y Cb Y Cr Y Cb Y Cr Y Cb Y Cr Y    Input value:               85 30 73 32 8C 36 75 3F 90 41 71 44 91 47 70 49    Absolute code:               8 3 7 3 8 3 7 3 9 4 7 4 9 4 7 4    Absolute value:               88 38 78 38 88 38 78 38 98 48 78 48 98 48 78 48    Absolute error:               -3 -8 -5 -6 +4 -2 -3 +7 -8 -7 -7 -4 -7 -1 -8 +1    Delta Code:    F 0 0 F 0 0 0 F 0 0 0 0 0    Delta value:    34 8C 38 74 3C 90 40 70 44 94 48 74 4C    Delta error:    -2 +0 -2 +1 +3 +0 +1 +1 +0 -3 -1 -4 +3    Output code:               8 3 7 F 0 0 F 0 0 0 F 0 0 0 0 4    Output value:               88 38 78 34 8C 38 74 3C 90 40 70 44 94 48 74 48    Output error:               -3 -8 -5 -2 +0 -2 +1 +3 +0 +1 +1 +0 -3 -1 -4    ______________________________________               +1

As noted above, an absolute code is selected as the first code for eachcomponent type (Y, Cr, or Cb). The first three output values aretherefore the absolute values generated using the absolute codes. Forthe next twelve input values, the delta codes produce a lower encodingerror, and therefore are used to generate the twelve correspondingoutput values. For example, the second luma sample has an input value of32xH. The previously-coded luma code was 3xH, corresponding to an outputluma value of 38xH. The resulting delta codes are therefore 34xH and3CxH, of which 34 is the closer to the input value of 32xH. Since thedelta code 0 results in less encoding error than the absolute code 3,the second luma sample is encoding using the delta code 0 to produce anoutput value of 34. For the final input value in the exemplary sequence,the encoding error produced with the absolute code is +1, while thedelta code results in an encoding error of +3, so the correspondingoutput value is generated using the absolute code. In the above example,when an absolute code and a delta code result in the same encodingerror, the delta code is selected.

A second exemplary embodiment of the video data encoding of the presentinvention utilizes eleven of the sixteen 4-bit codes, 3xH to DxH, asabsolute codes which correspond to CCIR-601 codes 1CxH to E4xH as shownin TABLE 2 below:

                  TABLE 2    ______________________________________    Input Range      Code   Output    ______________________________________    10-25            3      1C    26-39            4      30    3A-4D            5      44    4E-61            6      58    62-75            7      6C    76-89            8      80    8A-9D            9      94    9E-B1            A      A8    B2-C5            B      BC    C6-D9            C      D0    DA-EF            D      E4    ______________________________________

These absolute codes introduce a maximum encoding error of -10 to +9relative to the higher resolution CCIR-601 input codes. As in the firstembodiment, the input data values should be clipped to conform to the10xH to EFxH input range prior to encoding. Additional precision isprovided in the second embodiment by using the remaining five 4-bitcodes 0xH, 1xH, 2xH, ExH and FxH as delta codes. The delta code 0xHspecifies that the current encoded output value will be the same as theoutput value of the last previously-coded component of the same type (Y,Cr or Cb). The delta codes 1xH and FxH specify that the current encodedoutput value will be generated by adding two or subtracting two,respectively, to or from the output value of the last previously-codedcomponent of the same type. The delta codes 2xH and ExH specify that thecurrent encoded output value will be generated by adding eight orsubtracting eight, respectively, to or from the output value of the lastpreviously-coded component of the same type. As in the first embodiment,a delta code is used when it produces an output value which is closer tothe input value than that which would be produced using an absolutecode. The use of the "same as previous" delta code 0xH makes the secondexemplary embodiment of the video data encoding technique particularlywell-suited for use with the many practical video image sequences whichinclude color bars and "solid field" images.

The above-described video data encoding techniques greatly reduce theerror resulting from quantization of an encoded image. The amount ofmemory bandwidth required to store and process the images issignificantly reduced by representing each luma and chroma component byfour bits rather than eight, while the delta codes provide substantialreductions in encoding error. It will be apparent to those skilled inthe art that the above-described encoding techniques may be applied inalternative embodiments using different numbers of input and encodedbits, and different numbers and types of absolute and delta codes. Inaddition, the encoding techniques may be applied to other types of data,including video data in formats other than the exemplary format shown inFIG. 7A.

5. Single-Buffered Display Capture

Another feature of the present invention is a single-buffered displaycapture which is particularly well-suited for the implementation of apicture-in-picture (PIP) function for a video display. Thesingle-buffered display capture could be used in the graphics processor60 of the set top box processing system 10, and in numerous alternativevideo processing applications.

FIG. 8A shows an exemplary video processing system 320 in which thesingle-buffered display capture may be implemented. A graphics source322 supplies a graphics overlay or other suitable graphics signal to becombined with a video signal from a video source 324. The video signalcould be decoded MPEG-2 video from a decoder such as decoder 52 of FIG.1 or any other type of digitized video signal. The video signal fromsource 324 is supplied to a mixer 326 which combines the output of thegraphics source 322, video source 324 and a video display module 332into a single combined video output signal for display. The video signalfrom source 324 is also supplied to a video capture module 328 whichcaptures video frames in real time and decimates the captured frame to asmaller size. The video capture module 328 may also provide other signalprocessing functions such as compression. A frame storage memory 330provides temporary storage for video frames captured in the videocapture module 328. The video display module 332 reads data from theframe storage memory 330 to thereby construct a repositionable videowindow within the video display. The mixer 326 combines the originalvideo signal, any graphics overlay and the video window into a combinedsignal which is supplied to a video output module 334. The video outputmodule 334 converts the digital combined signal into an analog formatsuitable for use with display 336.

An exemplary application for the system 320 of FIG. 8A is in a digitalvideo set top box processing system such as that shown in FIG. 1. Duringnormal operation, the output of the video source 324 is displayed infull-screen resolution and the video capture module 328 and displaymodule 332 are not used. If a user changes the selected channel to, forexample, a pay-per-view channel, the system 320 could configure videocapture module 328 and video display module 332 to provide a combinedoutput signal which includes a video window showing a reduced-size imageof the pay-per-view channel surrounded by a graphics overlay detailinginformation about the event. After purchasing the pay-per-view event,the user would receive the full resolution video signal corresponding tothe event, and the video capture module 328 and video display module 332would again be deactivated.

The video display module 332 repositions the video image received fromvideo capture module 328 to an arbitrary position on the display screen.Video data for the display module 332 may therefore need to be availableeither before or after the video data provided directly from the source324 through the mixer 326 and output module 334 to the display 336. Theframe storage memory 330 buffers the captured video field such that thedisplay module 332 will always have access to the video data requiredfor display. The frame storage memory 330 also serves to allowsynchronization between the video signal supplied directly from source324 and the reduced-size signal supplied from video display module 332.

FIG. 8B illustrates a frame storage memory 330 which could be used toimplement a conventional double framestore buffering technique. Theconventional double buffering technique is designed to eliminate a"tearing" problem which may result if the top portion of the video dataoutput from the display module 332 is from a current frame, while thebottom portion is from a previous frame. The double buffering of FIG. 8Bsolves this tearing problem by allowing the capture module 328 to storedata from a current frame in a first framestore 338 while the displaymodule 332 is displaying data from a previously-captured frame stored insecond framestore 340. Although this conventional approach solves thetearing problem, it does so with an undesirable substantial increase inthe memory requirements of system 320. The present invention provides asingle buffering approach which solves the tearing problem without anyincrease in the system memory requirements.

The single buffering technique of the present invention takes advantageof the fact that the video frames from source 324 are often interlacedto thereby improve display resolution without increasing the amount ofdata per frame. For example, NTSC frames each include an even field andan odd field which are interlaced on display. The even field and oddfield are delivered sequentially so as to create the appearance of 525lines delivered at 60 fields per second, when in fact only 262 or 263lines at 60 fields per second are delivered. The present inventionutilizes this interlaced delivery of fields to remove theabove-described double buffering requirement without introducingtearing.

The single buffering technique may be implemented as follows. Initially,an odd-numbered vertical decimation factor is selected for use in videocapture module 328. In other words, the reduction ratio between theoriginal source image and the captured image is selected from theodd-numbered ratios 1:1, 3:1, 5:1, and so on.

The reason for this is that capturing at an even decimation ratio willonly capture a single field of the video frame, since all of theeven-numbered display lines are in the even field. Capturing at an evenratio may also introduce temporal artifacts in the displayed video whenobjects in a given scene move since the display module 328 will beredisplaying the captured even field lines on both the even and odddisplay fields.

The video capture module 328 and video display module 332 are thenconfigured to capture and display different fields at different times.As noted above, the capture module 328 and display module 332 mayoperate in synchronization such that the display module 332 directsdisplay of an even field at the same time that the capture module 328 iscapturing an even field. In accordance with the present invention, thedisplay module 332 directs the display of a captured odd field during aneven field display time, such that the buffering requirements arereduced to a single framestore buffer. This may be accomplished bymoving the image from the video display module 332 up a line or down aline during display. For example, in a display with 6 lines per field,with a 3:1 decimation factor in the video capture module 328, a total offour lines per frame will be captured for use in the reduced-size image,with two from each field. During a given even field, even field lines 4and 10 may be captured by capture module 328, while previously-capturedodd field lines 1 and 7 are displayed by display module 332. During agiven odd field, odd field lines 1 and 7 are captured andpreviously-captured even field lines 4 and 10 are displayed. The capturemodule 328 and display module 332 are thus configured to capture anddisplay, respectively, from different fields at different times.

The single-buffered display capture of the present invention thereforeoperates such that the lines captured from an even field in accordancewith the selected vertical decimation factor are displayed during thesubsequent odd field, while the lines captured from an odd field aredisplayed during the subsequent even field. This field-based allocationbetween capture and display processes in the video display module 332ensures that the above-described tearing problem will not occur, andthat the memory 330 can be implemented using a single framestore ratherthan two framestores as in a conventional double buffering technique.

6. Register-Based Process Sharing

The graphics processor 60 in the ASIC processor 20 of FIG. 1 mayimplement a register-based sharing mechanism which preventssimultaneously-running processes from interfering in their attempts toaccess graphics acceleration engines or other portions of the graphicsprocessor 60. The graphics processor 60 will generally include one ormore hardware-based drawing acceleration engines as well as a graphicsdriver. An exemplary graphics driver suitable for use with the presentinvention is the MAUI driver available from Microware, Inc. of DesMoines, Iowa. The MAUI driver and many other graphics drivers willgenerally allow multiple applications to simultaneously generate andsupply graphics data to the drawing acceleration engine. Eachapplication may be configured as a user process, such that a task switchin the acceleration engine could be triggered at any time during a givenprocess by a call directed to the acceleration engine. This may create aproblem for the acceleration engine in that the color registers andother internal state information may become corrupted if two or moreapplications simultaneously attempt to use the acceleration engine.Possible solutions to this problem include making a kernel save andrestore the state for any interrupted application, allowing only oneapplication to use the acceleration engine, or using a softwaresemaphore. However, each of these solutions may introduce additionalcomplexities or other undesirable results. The present inventionprovides an approach based on a hardware semaphore which avoids many ofthese undesirable results, and will be described in greater detailbelow.

FIG. 9A shows an exemplary implementation of a semaphore register 350used as a hardware semaphore in accordance with the invention. Thesemaphore register 350 includes an acquire bit portion 356, a processidentifier portion 354, and a remaining portion 356. In this example,the register 350 is configured as a 16-bit register, and may becontained within the graphics processor 60, the ASIC processor 20 orelsewhere in the processing system 10 of FIG. 1. The register 350 isused to control the access of multiple processes operating through agraphics driver to a drawing acceleration engine. The acquire bitportion 352 of the semaphore register 350 indicates to other processesthat the drawing acceleration engine has been acquired by anotherprocess. The process which has acquired the drawing acceleration enginewrites its identifier into the process identifier portion 354 of theregister 350. Other processes can determine if the drawing accelerationengine has been acquired by simply examining the acquire bit portion ofthe register 350, and if the engine has not been acquired, maythemselves acquire the engine.

FIG. 9B is a flow diagram illustrating the operation of the hardwaresemaphore feature of the present invention. In step 360, a given processoperating through the graphics driver attempts to acquire the semaphoreby writing its process identifier to the process identifier portion 354of the semaphore register 350. Step 362 indicates that before theprocess is permitted to write to the register 350, a determination ismade as to whether or not the acquired bit in the acquired bit portion352 of the register 350 has been set. If the acquire bit has been set,step 364 indicates that the process is denied access to the drawingacceleration engine and the register 350 unless the process has the sameprocess identifier as that already stored in the process identifierportion 354 of the register 350. If the acquire bit has not been set,the process attempting to acquire the semaphore stores its processidentifier in the process identifier portion 354 of register 350, and isthen permitted to utilize the drawing acceleration engine to theexclusion of other processes. In step 370, a determination is made as towhether the process has completed its use of the drawing accelerationengine. If the process has not completed its use of the engine, theprocess returns to step 368 and continues to use the engine. If theprocess has completed its use of the engine, the process clears theacquire bit in portion 352 of register 350, as shown in step 372. Thecleared acquire bit indicates to other processes that the engine is nowavailable to them. Although the hardware semaphore of the presentinvention has been illustrated in conjunction with controlling theaccess of graphics processes to a drawing engine, it should beemphasized that this is by way of illustration and not limitation. Thehardware semaphore may be utilized in other applications in which it isdesirable to control the access of one or more processes to astate-sensitive device. These alternative applications include hardwareacceleration circuitry for cyclic redundancy code (CRC) calculation, orany other type of shared processing resource.

7. Memory Arbitration

The present invention provides memory arbitration techniques which allowmultiple processes to share a common memory device or devices. In theexemplary processing system of FIG. 1, the memory arbitration techniquespermit a number of graphics, communication and other processes operatingwithin ASIC processor 20 to share the DRAM 40. This memory arbitrationeliminates the requirement for separate memory devices in multipleprocessing elements, and thus permits a more efficient andcost-effective processing system implementation. Although illustratedbelow in conjunction with multiple system processes sharing a singlememory device, it will be readily apparent that the disclosed techniquesare also applicable to multiple processes sharing multiple memorydevices.

The processes accessing a given memory device are referred to in thefollowing description as requestors. Each requestor may have differentmemory bandwidth and latency requirements. A list of possible requestorsin the processing system 10 of FIG. 1 include the following:

1) Directly-Mapped CPU Memory (CPU)

2) MPEG-2 Transport Stream Demultiplexed Video Buffer (VQM)

3) MPEG-2 Transport Stream Demultiplexed Audio Buffer (AQM)

4) MPEG-2 Transport Stream Demultiplexed Input Queue (IQM)

5) Graphics Overlay

6) PCM Audio

7) DRAM Refresh

8) ATM SAR Receive Cell Buffer

9) ATM SAR Transmit Cell Buffer

10) Smart Card Message Buffer

11) Video Capture Buffer

12) Picture in Graphics (PIG)

Each of these requestors may be permitted to utilize portions of theDRAM 40 in accordance with an arbitration technique. In one possibleembodiment, an arbitration technique is provided which assigns apriority to each of the various requestors. The priorities may beassigned in the following order:

1) Graphics Overlay

2) Picture in Graphics (PIG)

3) MPEG-2 Transport Stream Demultiplexed Input Queue (IQM)

4) Video Capture Buffer

5) Directly Mapped CPU Memory (CPU)

6) MPEG-2 Transport Stream Demultiplexed Video Buffer (VQM)

7) DRAM Refresh

8) PCM Audio

9) MPEG-2 Transport Stream Demultiplexed Audio Buffer (AQM)

10) Smart Card Message Buffer

11) ATM SAR Receive Cell Buffer

12) ATM SAR Transmit Cell Buffer

The arbitration technique is implemented in the DRAM controller 42 ofASIC processor 20 in this exemplary embodiment, but could be providedusing other elements of processing system 10 in other embodiments. TheDRAM controller 42 receives requests for memory bandwidth from theabove-noted requestors, and allocates the memory in accordance with theestablished priority. The ATM SAR receive and transmit cell buffers areassigned the lowest priority because the cell buffers are relativelydeep and therefore the SAR memory accesses may be held off for a longerperiod of time without overflowing the buffers.

TABLE 3 below illustrates a maximum allowable latency and a maximumactual latency for each of the above-noted requestors in an exemplaryimplementation of the memory arbitration technique of the presentinvention.

                  TABLE 3    ______________________________________                      Maximum Allowable Latency                                       Max. Actual    Requestor            Bandwidth (40.5 MHz clock cycles)                                       Latency    ______________________________________    Graphics            108 Mbit/s                      48               24    Overlay    PIG     108 Mbit/s                      48               36    IQM     60 Mbit/s or                      64               48            44 Mbit/s    Video   54 Mbit/s 96               60    Capture    CPU       --      192              96    VQM     16 Mbit/s 256              106    DRAM    (1/512 clock                      510              192    Refresh cycles)    PCM Audio            768 Kbit/s                      840              242    AQM     768 Kbit/s                      840              314    Smart Card            (1/1408   1406             398            clock cycles)    ATM     16 Mbit/s 1000             442    ______________________________________

A number of exceptions to the established priority may be provided. Forexample, if the MPEG-2 transport stream input queue is granted accessand other lower-priority requestors are also requesting access, one ofthe lower-priority requestors may be granted a first memory access cyclebefore the transport stream input queue is granted a second memoryaccess cycle. Another possible exception could specify that if thedirectly-mapped CPU memory is granted an access and other lower-priorityrequestors are also requesting access, one of the lower-priorityrequestors is granted a first memory access cycle before thedirectly-mapped CPU memory is granted a second memory access cycle. Asanother example, if an ATM transmit cell buffer request is receivedwhile an ATM receive cell buffer request has been granted access, thetransmit request is guaranteed to receive the next access available forATM.

The memory arbitration features of the present invention provideacceptable latencies for each of the requestors, while providing highbandwidth for the direct memory mapping operations of CPU 30, the inputqueue of MPEG-2 transport stream demultiplexer 50 and the video captureand graphics overlay operations of graphics processor 60. For example,with all requestors operating, the CPU 30 may still receive on the orderof half of the available memory bandwidth. Although the CPU memoryaccesses experience a higher latency as a result of collisions with thedemux, video and graphics accesses, the overall throughput for allrequestors can be maintained within an acceptable range.

8. ATM Segmentation and Reassembly (SAR)

8.1 General Description

As noted above, the ASIC processor 20 of FIG. 1 includes an asynchronoustransfer mode (ATM) segmentation and reassembly (SAR) device 90 forproviding an interface to an ATM network. ATM networks are generallydesigned to support high-speed, low-delay multiplexing and switching ofvoice, data, video and other types of user information traffic. An ATMnetwork processes user traffic in fixed-length cells of 53 bytes. A5-byte header in each cell typically includes a virtual channelidentifier (VCI) and a virtual path identifier (VPI) associated with thecorresponding cell. The VCI and VPI fields together identify a virtualcircuit (VC) which is established when a user requests a networkconnection in an ATM system. Additional details regarding these andother aspects of ATM systems can be found in the ATM Forum, "ATMUser-Network Interface Specification," Version 3.1, September, 1994, andin Martin de Prycker, "Asynchronous Transfer Mode: Solution forBroadband ISDN," Ellis Horwood, New York, 1993, both of which areincorporated by reference herein.

The ATM SAR 90 in the ASIC processor 20 of FIG. 1 is configured in thisexemplary embodiment to perform ATM adaptation layer 5 (AAL5)segmentation and reassembly. A general description of conventionalsegmentation and reassembly operations for AAL5 can be found in theabove-cited ATM Forum and M. de Prycker references. The reassemblyoperations may include filtering a received ATM cell stream, sorting thecells by virtual circuit, accumulating cells until an entire AAL5 frameis received, checking the AAL5 trailer fields, stripping the trailerfields and other AAL5 encapsulation and passing the data to upperprotocol layers. The segmentation operations performed in the ATM SAR 90may include converting a variable-length payload into an AAL5 frame,generating a 32-bit cumulative cyclic redundancy code (CRC) over theentire AAL5 frame, and providing flow control by interleaving cells forone virtual circuit with the cells of others to thereby utilize a fixedpercentage of the overall ATM bandwidth. The ATM SAR 90 uses acombination of hardware and software to provide these and otherfunctions for multiple virtual circuits. Conventional ATM SARs generallyuse a primarily hardware-based approach which keeps running counts ofthe receive and transmit CRCs for each channel and therefore requirerelatively large amounts of on-chip memory. An ATM SAR in accordancewith the present invention provides improved performance with a reducedamount of memory in part by utilizing software to direct availablehardware resources more efficiently.

The ATM SAR 90 is particularly well-suited for use with fixed-sizekernel data structures aligned to power of two boundaries. One suchkernel data structure is referred to as an MBUF. The MBUF data structureis often utilized in UNIX-like operating systems such as the OS-9operating system available from Microware, Inc. of Des Moines, Iowa. Agiven MBUF corresponds generally to a fixed-size area of memory andincludes both a header and a data portion. For example, the MBUFsutilized in conjunction with the OS-9 operating system are each 64 bytesin length, with a 16-byte header and a 48-byte data portion. FIG. 12Aillustrates a number of exemplary MBUFs. The MBUF headers containinformation which allow the MBUFs to be grouped together into largerdata structures or packets. This information includes an identifier ofthe MBUF type. The MBUF type specifies whether the MBUF is unused, orcontains a particular type of data such as network data, a networkheader, a network trailer or the like. Other header information includesthe number of bytes of valid data in the MBUF, an offset indicatingwhere the valid data begins in the data portion, a pointer indicatingwhere the next MBUF with data associated with the corresponding packetcan be found, and a pointer indicating where the first MBUF of the nextpacket can be found.

Software running on the CPU 30 of the processing system 10 can utilizethis MBUF header information to process packets in the form of a chainof MBUFs. The software can add and delete network headers and trailerson packets as the packets are processed by various software layers. Toadd a network header, the software need only append an MBUF with a dataportion containing the network header to the start of an MBUF chain. Todelete a network header, the software need only adjust the value of anoffset in the MBUF which contains the network header. An advantage ofusing a fixed-size kernel data structure such as the MBUF is that thenumber of memory read and write operations required to process a givenpacket are considerably reduced. Different network protocol layers canpass MBUF chains and modify data by manipulating only theabove-described offsets and pointers in the MBUF headers. The ATM SAR ofthe present invention takes advantage of these and other similarfeatures of MBUF data structures to facilitate processing. For example,a reassembly operation may involve arranging the data received on agiven virtual circuit into an MBUF chain and placing the MBUF chain intoa receive queue for an upper protocol layer to parse. As will bedescribed in greater detail below, the cell buffers used to receive andtransmit ATM cells may be configured in accordance with the MBUF datastructure or another similar data structure with the above-describedpointer and chaining features.

FIG. 10 is a block diagram illustrating various features of an ATM SARin accordance with the invention. The ASIC processor 20 of FIG. 1 isshown in this example as including a UTOPIA port 400, a direct memoryaccess (DMA) device 402, and a memory interface 404. The UTOPIA port 400provides a standard interface to an ATM physical (PHY) layer device suchas a synchronous optical network (SONET) receiver or transmitter, and isdescribed in greater detail in the above-cited ATM Forum reference. TheUTOPIA port in this embodiment is configured to clock cell data at arate of 20.25 MHz, although other data rates could of course be used.The DMA device 402 and memory interface 404 are controlled in accordancewith instructions executed by the CPU 30, and provide for transfer ofdata to and from the DRAM 40 in a manner to be described in greaterdetail below. The ATM SAR device 90 in the ASIC processor 20 includes aSAR receiver 405, a CRC processor 406 and a SAR transmitter 407. The SARreceiver 405 and SAR transmitter 407 are shown in greater detail inFIGS. 11A and 14A, respectively. The CRC processor 406 is illustrated inFIG. 13 and serves to process receive and transmit CRC information in amanner to be described in greater detail below. The DRAM 40 in thisexemplary embodiment is shown as including a receive ring portion 410, atransmit ring portion 412 and a cell buffer portion 414. The receivering portion 410 is used to store an array of pointers which specifyaddresses in the cell buffer portion 414 in which received ATM cellswill be stored. The transmit ring portion 412 is used to store an arrayof pointers which specify addresses in the cell buffer portion 414 ofATM cells to be transmitted. The cell buffers may each be configured as64-byte MBUFs in accordance with the above-described MBUF datastructure. Each cell buffer thus corresponds to a single MBUF andincludes the above-described header and data portion. The pointersstored in the receive ring portion 410 and the transmit ring portion 412therefore correspond to the above-described MBUF header pointers and maybe used to chain together ATM cells for a given virtual circuit in amanner to be described in greater detail below.

8.2 Reassembly

FIG. 11A shows an exemplary SAR receiver 405 in accordance with theinvention. The receiver 405 includes a receive state machine 420,receive logic 422 and a receive buffer 424. The receive buffer 424 holdsATM cell data received from the UTOPIA port 400 until it can beprocessed in the receiver 405. The buffer 424 may be implemented as an8×16 single-ported RAM in order to provide sufficient buffering for a16-byte burst data transfer. The state machine 420 and logic 422 operatein conjunction with host CPU 30 and ASIC processor 20 to provide receivefunctions which are illustrated in the flow diagrams of FIGS. 11B and11D below.

The receiver 405 further includes a receive VCI look-up table 426 whichmay be implemented as a 16×16 RAM. The receive VCI table 426 containsinformation identifying the particular VCIs which are supported by thereceiver 405. The receiver 405 accepts and processes a given incomingcell if that cell has a VCI which is found within the look-up table 426.The contents of the look-up table can be updated by software operatingon host CPU 30. The table 426 may be stored in DRAM 40 or elsewherewithin the processor 20. The receiver 405 may operate at a clock rate onthe order of 20.25 MHz.

FIG. 11B is a flow diagram illustrating a portion of an exemplaryreassembly operation in accordance with the invention. A stream of ATMcells is received in the processor 20 via the UTOPIA port 400 in aconventional manner. The cells are then filtered using the look-up table426 of SAR receiver 405. As noted above, the look-up table 426 in thisexemplary embodiment is a 16×16 table which stores the VCIs for thecells to be accepted. In step 430, the processor 20 linearly sequencesthrough the 16×16 table 426 looking for a match between a VCI in anincoming cell header and one of the VCIs previously stored in the first15 entries of the 16×16 table. Entry 16 of the 16×16 table itself servesas a hash table in which each bit of the entry indicates whether or nota particular VCI is to be accepted in the receiver 405 of processor 20.Although the entire VCI is compared for a match in this embodiment,alternative embodiments may utilize a subset of the VCI bits, such asthe 10 least significant VCI bits, or may utilize the VPI in conjunctionwith all or a portion of the VCI.

In step 432, a determination is made as to whether a match has beenfound between the incoming ATM cell header and one of the VCIs stored inthe first 15 entries of the 16×16 look-up table 426. If a match isfound, the corresponding cell is accepted as shown in step 434. If amatch is not found, entry 16 is used as a hash table with the low fourbits of the incoming cell VCI serving as a bit index into the hashtable. The value of the bit in the hash table position indicated by thelow four bits of the incoming cell VCI will then determine whether ornot the cell will be accepted. For example, if the incoming cell has aVCI in which the low four bits are "1010", the receiver 405 in processor20 will examine bit position 11 in the entry 16 hash table, and willindicate a match if that bit is a logic "1", or no match if that bit isa logic "0". If a match is found between a portion of an incoming cellVCI and a hash table bit, the cell is accepted as indicated by steps 438and 440. This hash table arrangement allows the receiver 405 ofprocessor 20 to simultaneously service more than 16 different virtualcircuits using minimal hardware. Software running on CPU 30 may beutilized to provide additional filtering of the cells matched using thehash table. The software may also be configured to alter the look-uptable 426 so as to move virtual circuits between the first fifteenentries and the hash table in the event that collisions are detected. Ifthere is no match found between an incoming cell VCI and one of thefirst 15 entries of the 16×16 table or one of the hash table bits, thecell is discarded as shown in step 442. If the cell is accepted in step434 or 440, the cell is written to a designated 64-byte MBUF cell bufferin the cell buffer portion 414 of the DRAM 40 as indicated in step 444.A header error control (HEC) byte is removed from the 53-byte acceptedcell, and the remaining 52-byte portion of the cell is written to thedesignated cell buffer. The address of the cell buffer in which theaccepted cell is stored is determined by a pointer which the receiver405 retrieves from the receive ring portion 410 of the DRAM 40. As notedabove, the cell buffers may be configured to include a header and a dataportion in accordance with the above described MBUF data structureformat.

FIG. 11C illustrates an exemplary receive ring 410 in accordance withthe invention. The receive ring 410 in this example is configured as anarray of pointers.

The size of the receive ring may be on the order of four DRAM pages, or4096 bytes, such that it can include up to 1024 32-bit pointers and cansupport up to 48K of received cell data. As noted above, each pointeridentifies a particular cell buffer in the cell buffer portion 414 ofthe DRAM 40. Each pointer also indicates whether an incoming cell hasbeen stored in the corresponding buffer, and if a cell has been storedin the buffer, the pointer specifies the VCI and/or other identifyinginformation for that cell. In operation, the receiver 405 in the ASICprocessor 20 retrieves a receive ring entry including a pointer to afree cell buffer, waits for an incoming cell to be received and acceptedin the manner described in steps 430-444 of FIG. 11B, and stores theaccepted cell in the cell buffer indicated by the retrieved receive ringpointer as shown in step 444 of FIG. 11B. The receiver 405 thenretrieves the next available pointer from the receive ring. Theexemplary receive ring of FIG. 11C is shown after a number of incomingATM cells have been accepted and stored. The ring includes pointers tovarious cells for three virtual circuits identified as VCI1, VCI2 andVCI3. The receive ring also includes a number of pointers to empty cellbuffers, as well as a pointer to a cell buffer in which acurrently-received cell will be stored. The ring pointer shown to theleft of the receive ring 410 in FIG. 11C identifies the current receivering entry being accessed by the receiver 405.

The receive ring 410 may be initialized using software running on hostCPU 30. For example, software can be used to allocate a number of cellbuffers for a block of incoming ATM cell data and to store pointers tothe allocated buffers in the receive ring. The software is alsoconfigured to periodically step through the receive ring to determine,for example, if any cells accepted via the above-described hash tablecollide with other cells having confirmed valid VCI values. The softwaremay also utilize the pointers for cells having a given VCI to form achain of cells for that VCI.

As noted above, the cell buffers may utilize an MBUF data structure. Thesoftware can therefore use the above-described MBUF pointers to form achain of cell buffers for a given VCI. The software may be used toprovide the ring pointer function as shown in FIG. 11C which serves toidentify the pointer which will be used for the currently-received cell.The software may also utilize a number of interrupt bits to monitor thestatus of the receive ring. For example, a receive ring warning (RRW)flag and a receive ring limit (RRL) flag may be used. The RRW flag canprovide an indication to the software that the receive ring is runningout of pointers to empty cell buffers. The RRL flag can provide anindication that the receive ring has actually run out of pointers toempty cell buffers, and can be used to automatically disable the furtherreceipt of additional ATM cells. The software can also be used to causean interrupt to be flagged on the receipt of a cell including a headerin which the AAL5 end-of-frame bit is set, or on receipt of any otherparticular type of cell. If a cell with a set AAL5 end-of-frame bit isreceived, the processor 20 and CPU 30 are thereby made aware that a fullAAL5 frame has been received for a given virtual circuit, such thatframe-level processing may then be performed for that virtual circuit.

FIG. 11D illustrates processing operations performed in the processor 20and CPU 30 during ATM reassembly. Step 450 indicates that ATM cell datais received, filtered and stored in the manner illustrated inconjunction with FIG. 11B. If most or all pointers in the receive ringare already in use, or if a cell including a set AAL5 end-of-frame bitis received, steps 452 and 454 indicate that an interrupt is provided tothe host CPU 30. For example, the above-described RRW or RRL flags maybe used to provide the indication to the CPU 30 that most or all receivering pointers are in use. A similar interrupt may be triggered uponreceipt of a cell with the end-of-frame bit set. If none of theseconditions is met, there is an adequate supply of available receive ringpointers, and the process returns to step 450 to continue to receive,filter and store ATM cell data using the receive ring pointers in themanner previously described. If a set end-of-frame bit has not beenreceived but most or all receive ring pointers are in use, steps 456 and458 indicate that the host CPU software should service the receive ringto prevent an overflow condition. The host CPU software services thereceive ring by stepping through the ring to form a chain of occupiedcell buffers for each of the virtual circuits supported by the receiver.As will be described in conjunction with FIGS. 12A-12H below, each ofthe chains includes a list header identifying the virtual circuit, andany pointers to cell buffers in a given VCI chain can then be removedfrom the receive ring. This frees up space in the receive ring for newpointers which identify empty cell buffers. As part of the receive ringservicing operation, the host CPU software replaces any pointers whichare placed into a VCI chain with new pointers from a freelist of emptycell buffers. It should be noted that this receive ring servicingoperation may be performed upon receipt of a set RRW or RRL flag, afterreceipt of a particular number of cells, or at a predetermined timeafter the last receive ring servicing operation. The servicing operationreplenishes the supply of available receive ring pointers, and theprocess of FIG. 11D then returns to step 452 to receive, filter andstore additional received cells.

The receipt of a cell with a set end-of-frame bit indicates to the hostCPU software in step 460 that an AAL5 frame can now be reassembled forthe given VCI for which the set end-of-frame bit was received. The framereassembly in step 460 involves stepping through the receive ring tolink the pointers for the given VCI into a chain of cell buffers whichhold the received cells for that VCI. A partial chain of cell buffersmay already exist for the given VCI as a result of a prior receive ringservicing operation performed in step 458. The pointers for the givenVCI are therefore either linked into an existing chain for that VCI orformed into a first chain for that VCI if there is no existing chain forthat VCI. As noted above, the chain for a given VCI is identified by adistinct list header, and any pointers which are placed into the chainmay be subsequently removed from the receive ring and replaced with newpointers.

The host CPU software in conjunction with CRC processor 406 performs aCRC computation to determine if the frame should be accepted orrejected. Step 462 indicates that the CRC computation involves the hostCPU software stepping through the corresponding VCI cell buffer chainand pointing the dedicated hardware of the CRC processor 406 to eachcell of the frame in turn until the processor 406 has computed the CRCfor the full frame. The resulting computed frame CRC is then compared tothe CRC field of the AAL5 trailer at the end of the last cell in theframe as indicated in step 464. Other criteria for frame acceptance mayalso be used. For example, the length field of the frame trailer couldbe checked to determine if any cells were dropped. If the computed frameCRC matches the CRC field of the trailer, and any other frame acceptancecriteria are met, the frame is accepted. The trailer of the acceptedframe is then removed, and the frame is passed to upper protocol layersassociated with host CPU 30 or other portions of processing system 10for additional processing. After or during the upper layer processing,the accepted frame data may be written to application buffers. The hostCPU software can then free up the cell buffers and correspondingpointers for use with subsequently-received cells, as shown in step 466.If the computed frame CRC does not match the CRC field, or any otherframe acceptance criteria are not met, step 464 indicates that the framemay be rejected. The host CPU software can then immediately free up thecell buffers and corresponding pointers of the rejected frame, as shownin step 466.

FIGS. 12A-12H illustrate an exemplary reassembly operation in accordancewith the present invention. FIG. 12A serves to illustrate theabove-described MBUF data structure which may be utilized in an ATM SARdevice in accordance with the present invention. FIG. 12A shows a groupof MBUFs arranged into a first packet 502, a second packet 504 and athird packet 506. Each of the packets 502, 504 and 506 includes multipleMBUFs 510-i, i=1, 2, . . . N. The first packet 502 includes five MBUFs510-1 through 510-5, while the second packet 504 and the third packet506 include three MBUFs 510-i and two MBUFs 510-i, respectively. Each ofthe MBUFs 510-i includes a header 512 and a data portion 514. As notedabove, each MBUF may be 64 bytes in length, with a 16-byte header and a48-byte data portion. The entire 48-byte data portion 514 may not beoccupied by data in all MBUFs. Some of the MBUFs are therefore shown inFIG. 12A as including an unoccupied portion 516.

For example, the data portion of the first MBUF 510-1 of the packet 502is only partially filled. This partially filled data portion may containonly a network header which was appended to the packet 502 by networkprotocol software. The data portions of the middle three MBUFs 510-2,510-3 and 510-4 of the packet 502 contain user data to be sent in packet502. The data portion of the middle MBUF 510-3 is only partially-filledbecause the user data did not fill three entire MBUFs. The data portionof the final MBUF 510-5 of the packet 502 contains a network traileradded by the network protocol software. As noted above, each 64-byteMBUF may correspond to a particular cell buffer in the cell bufferportion 414 of the memory 40. The MBUFs 510-i will therefore be referredto as cell buffers in the following description.

FIG. 12B illustrates the status of a group of cell buffers 510-i at theinitialization of a reassembly operation. A list header designatedfreelist 522 identifies all unused cell buffers 510-i. All of the cellbuffers 510-i are initially on the freelist 522. Driver software runningon CPU 30 directs the operation of the SAR receiver 405. The host CPUsoftware prepares the receiver for cell reception by removing cellbuffers from the freelist 522 and writing pointers to the removed cellbuffers into the receive ring 410 as shown in FIG. 12C. The receive ring410 illustrated in FIG. 12C thus includes a series of pointers to emptycell buffers. The software points the SAR receiver 405 to the firstentry of the receive ring identifying an empty cell buffer. The receivering pointer is designated by the arrow to the left of the receive ring410. It will be assumed for the remainder of this example that the SARreceiver 405 is configured to receive data on three different VCIsdesignated VCI1, VCI2 and VCI3. The software running on CPU 30 directsthe SAR receiver 405 to filter out all VCIs other than VCI1, VCI2 andVCI3. The software also maintains three list pointers 524, 526 and 528which are used to form cell buffer chains for cells received on VCI1,VCI2 and VCI3, respectively.

The receiver 405 retrieves the receive ring entry indicated by thereceive ring pointer and awaits the receipt of an ATM cell. An ATM cellarriving with a VCI which corresponds to either VCI1, VCI2 or VCI3passes through the above-described VCI filter and is accepted by thereceiver 405. The receiver 405 then writes the first four bytes of theATM cell header and the 48 bytes of ATM cell data into the cell bufferidentified by the receive ring entry. The receiver 405 then advances thering pointer to the next entry in the receive ring and retrievestherefrom a pointer to the next available cell buffer. This cell bufferis used to store the next cell received and accepted for VCI 1, VCI2 orVCI3. FIG. 12D shows the status of the cell buffers 510-i and thereceive ring 410 after receipt of a number of ATM cells for VCI1, VCI2and VCI3. The areas 530 shown in each of the occupied cell bufferheaders correspond to a 4-byte ATM cell header.

As noted above in conjunction with FIG. 11D above, the host CPU softwareperiodically services the receive ring 410 to avoid overflow. Thisservicing operation may be in response to an interrupt conditiongenerated by the receiver 405. The interrupt condition may be triggeredby the receipt of an ATM cell with the AAL5 end-of-frame bit set, or byreaching the limits specified for setting the above-described RRW or RRLflags. The software services the receive ring by first examining thereceive ring pointer to determine how many cells have been receivedsince the last time the ring was serviced. The software then stepsthrough the receive ring, examining the stored ATM cell identified byeach of the receive ring entries to determine which VCI the cell belongsto. All stored cells for a particular VCI are then linked into a cellbuffer chain for that VCI. The list headers 524, 526 and 528 are used toidentify the cell buffer chains for VCI1, VCI2 and VCI3, respectively.FIG. 12E illustrates the three cell buffer chains formed as a result ofthe receive ring servicing operation. It can be seen that list header524 for VCI1 identifies a single cell buffer containing the single cellreceived on that VCI. The list header 526 for VCI2 identifies a chain ofthree cell buffers, while the list header 528 for VCI3 identifies achain of two cell buffers. As noted above, the pointers to any cellbuffers identified by one of the list headers 524, 526 or 528 areremoved from the receive ring. The software may then remove free cellbuffers from the group identified by the freelist 522 and load thecorresponding pointers into the newly-freed receive ring entries.

The host CPU software also determines if a stored cell has theend-of-frame bit 532 set in its header 530. In this exemplaryembodiment, the last cell buffer 510-i in the chain identified by theVCI3 list header 528 includes an ATM cell header 530 with a setend-of-frame bit 532. This indicates to the driver software that anentire AAL5 frame has been received for VCI3, and that post-processingsuch as the above-described CRC computation may be performed on thereceived VCI3 AAL5 frame.

The host CPU software may perform the post-processing at the same timethe receive ring is serviced, or may schedule the post-processing forperformance at a future time. The post-processing may also includechecking a frame length field in the AAL5 trailer at the end of theframe to ensure that no cells were dropped. As described in conjunctionwith FIG. 11D above, a CRC computed for the entire frame is compared tothe CRC field of the frame trailer to determine if the frame should beaccepted or rejected. The CRC computation is therefore performed in thisembodiment after an entire AAL5 frame has been received, instead of asthe individual cells are received. This provides improved ATM processingefficiency in set top box and other processing applications.

As noted above, the software running on the host CPU 30 could beconfigured to point the dedicated CRC hardware in CRC processor 406 ofFIG. 13 to each cell of the frame in turn until the full frame CRC iscomputed. Alternatively, the frame CRC could be computed entirely insoftware. If the computed CRC does not match the CRC field from theframe trailer, the entire frame is rejected and the cell buffers andcorresponding pointers are linked back into the freelist for laterreuse. If the computed CRC does match the trailer CRC field, the hostCPU software adjusts the cell buffer headers for the VCI chain as shownin FIG. 12G to remove the ATM cell headers, and also removes the AAL5trailer and any padding. It can be seen in FIG. 12G that the ATM cellheader portions have been removed from the VCI3 cell buffer chain, andthat the corresponding list header has been directed to an upperprotocol layer. After the upper protocol layer processing is completed,the data portions of the processed AAL5 frame may be copied intoappropriate application buffers, and the newly-freed cell buffers may belinked back into the freelist for later reuse. FIG. 12H illustrates thegroup of cell buffers after the buffers previously associated with theVCI3 chain have been returned to the freelist. It can be seen from FIG.12H that a number of additional cells have been received and stored incell buffers, including a cell on VCI2 having a cell header 540 with aset end-of-frame bit 542. The host CPU software will recognize the setend-of-frame bit 542 and perform or schedule frame processing for VCI2.

FIG. 13 illustrates an exemplary CRC processor 406 in greater detail.The processor 406 includes a CRC state machine 570, CRC logic 572 and aholding buffer 574. The CRC state machine 570 and CRC logic 572 combineto perform the above-noted CRC calculations in a well-known manner. TheCRC processor 406 may operate at a clock rate of 40.5 MHz. The holdingbuffer 574 provides temporary storage of data blocks on which CRCcalculations are to be performed, and may be implemented as an 8×16single-ported RAM. The CRC processor 406 further includes a transmitaccumulator register 576, a receive accumulator register 578, and a CRCcommand register 580. A CRC operation may be initiated on a given datablock by writing the start address of the block, the length of the blockand a command into the command register 580. Exemplary commands whichmay be supported by the CRC processor 407 include commands requestingcomputation of a partial CRC for a receive or transmit cell or group ofcells. Alternatively, a command may be provided for generating acumulative CRC for any given set of receive or transmit cell data. TheCRC calculation requested by the command written to register 580 iscarried out in a conventional manner using the state machine 570 andlogic 572. The results of the calculation are stored in the appropriateaccumulator register 576 or 578. Separate accumulator registers areprovided for receive and transmit in order to prevent interferencebetween interruptable receive and transmit processes. The host CPU 30interfaces with the registers 576, 578 and 580 of the CRC processor 406to request and obtain the above-noted frame CRCs. In alternativeembodiments, the CRC function of ATM SAR 90 could be provided elsewherein the ASIC processor 20 or in the CPU 30.

8.3 Segmentation

FIG. 14A is a block diagram of the SAR transmitter 407 incorporated intothe ATM SAR 90. The SAR transmitter 407 includes a transmit statemachine 602, transmit logic 604 and a transmit buffer 606. The transmitstate machine 602 and transmit logic operate in conjunction with hostCPU 30 and other portions of ASIC processor 20 to provide segmentationfunctions to be described in greater detail below. The transmit buffer606 serves to buffer ATM cell data prior to its transmission via theUTOPIA port 400 and may be implemented as an 8×16 single-ported RAM. TheSAR transmitter 407 may be configured to operate at a clock rate of20.25 MHz.

FIG. 14B is a flow diagram illustrating a portion of an exemplarysegmentation operation in accordance with the present invention. Thesegmentation operation utilizes a transmit ring 412 stored in a portionof the DRAM 40 as shown in FIG. 10. The transmit ring 412 in thisexemplary embodiment is implemented as one DRAM page, or 1024 bytes, andtherefore may include up to 256 32-bit pointers. This allows thetransmit ring to support up to 12K of transmit cell data. It should benoted that the SAR transmitter 407 incorporates transmit ring warning(TRW) and transmit ring limit (TRL) flags which operate to provideoverflow indications to the host CPU 30 in a manner similar to thatdescribed above for the corresponding receive ring flags RRW and RRL.

Step 610 of FIG. 14B indicates that in one possible embodiment of theinvention, the host CPU software operates in conjunction with theabove-described CRC processor 406 to realign the cell data. The need forrealignment can be appreciated by reference to packet 502 of FIG. 12A,which includes partially-filled cell buffers 510-1 and 510-5 appended tothe start and end of the packet as a result of processing performed byupper protocol layers. The realignment operation is used to providepacked cells suitable for ATM transmission, and involves copying thecell data from a source location to a destination location. The sourceand destination locations may be different cell buffers or differentportions of the same cell buffer. Step 610 of FIG. 14B indicates thatthe host CPU software points dedicated CRC hardware in the CRC processor406 to source and destination buffer locations such that the cell datacan be copied from the source to the destination and thereby properlyrealigned. The CRC processor 406 may realign the cell data in 16-byteDRAM bursts at the same time that it calculating the cumulative transmitCRC for a given frame. The CRC holding buffer 474 has a 16-byte capacityand is used to support this burst data retrieval function. The CRCprocessor 407 may also be configured to accommodate odd length and oddalignment buffers. For example, the CRC logic 472 may be operative torecognize and process a pair of command bits specifying whether thefirst byte and/or the last byte of a given burst data transfer should beeliminated. Step 612 indicates that the CRC processor 406 computes aframe CRC as it copies and realigns each block of cell data in thatframe. The host CPU software is responsible for storing appropriate cellheaders for the realigned cells. The data retrieval and storageoperations performed in the realignment process may utilize the DMAdevice 402 of ASIC processor 20.

After the realignment is complete, step 614 indicates that the host CPUsoftware retrieves the full frame CRC from the transmit accumulatorregister 576 of CRC processor 406, and places it in an AAL5 trailer inthe last cell of the frame. The host CPU software then loads pointersfor the cell buffers in the frame into the transmit ring 412 as shown instep 616. The software directs the loading of the transmit ring suchthat cells for a particular VCI are not transmitted more often than isallowed by a quality of service (QOS) agreement made with the network atconnection set-up. The transmit ring loading may involve interleavingthe cells for the various VCIs, and inserting pointers to null cells atappropriate transmit ring locations. It should be noted that a singlecell buffer could be allocated for all inserted null cells, since allnull cell pointers may identify the same cell buffer. The transmitter407 retrieves a pointer from the transmit ring, retrieves the cell dataand cell header identified by the retrieved pointer, and transmits thecell to the ATM PHY layer via the UTOPIA port 400 of ASIC processor 20.The transmit ring pointer is then incremented to the identify the nexttransmit ring entry to be retrieved by the transmitter 407, and thus thenext cell to be transmitted to the ATM PHY layer. The cell retrievaloperations performed by transmitter 407 may utilize the DMA device 402of processor 20. The host CPU software is configured to service thetransmit ring periodically by stepping through the ring, storingpointers for cells to be transmitted, and linking the cell buffers andpointers of already-transmitted cells back into the freelist for reuse.The servicing of the transmit ring may be initiated in response tochanges in the status of the above-noted TRW or TRL flags.

It should be understood that the foregoing description is merelyillustrative of the invention. Numerous alternative embodiments withinthe scope of the appended claims will be apparent to those of ordinaryskill in the art.

The claimed invention is:
 1. A method of converting an input data streamincluding a sequence of input data blocks into a converted streamsuitable for addressing a look-up table, the method comprising the stepsof:determining if an input block of the input data stream corresponds toa predetermined value; combining the input block with apreviously-stored identifier of a first portion of the look-up table ifthe input block does not correspond to the predetermined value; andstoring an identifier of a second portion of the look-up table if theinput block does correspond to the predetermined value, wherein the stepof storing further includes the steps of receiving a subsequent inputblock of the input data sequence and storing the subsequent input blockas the identifier of the second portion.
 2. A method of converting aninput data stream including a sequence of input data blocks into aconverted stream suitable for addressing a look-up table, the methodcomprising the steps of:determining if an input block of the input datastream corresponds to a predetermined value; combining the input blockwith a previously-stored identifier of a first portion of the look-uptable if the input block does not correspond to the predetermined value;accessing the look-up table using an address corresponding to the resultof the step of combining the input block with a previously-storedidentifier of a first portion of the look-up table; and storing anidentifier of a second portion of the look-up table if the input blockdoes correspond to the predetermined value.
 3. A method of converting aninput data stream including a sequence of input data blocks into aconverted stream suitable for addressing a look-up table, the methodcomprising the steps of:determining if an input block of the input datastream corresponds to a predetermined value; combining the input blockwith a previously-stored identifier of a first portion of the look-uptable if the input block does not correspond to the predetermined value;combining a subsequent data block with the previously-stored identifierto thereby provide an address into the look-up table; and storing anidentifier of a second portion of the look-up table if the input blockdoes correspond to the predetermined value.
 4. A method of converting aninput data stream including a sequence of input data blocks into aconverted stream suitable for addressing a look-up table, the methodcomprising the steps of:determining if an input block of the input datastream corresponds to a predetermined value; combining the input blockwith previously-stored identifier of a first portion of the look-uptable if the input block does not correspond to the predetermined value;combining a subsequent data block with the stored identifier of a secondportion of the look-up table to thereby provide an address into thelook-up table; and storing an identifier of a second portion of thelook-up table if the input block does correspond to the predeterminedvalue.
 5. A method of converting an input data stream including asequence of input data blocks into a converted stream suitable foraddressing a look-up table, the method comprising the stepsof:determining if an input block of the input data stream corresponds toa predetermined value; combining the input block with apreviously-stored identifier of a first portion of the look-up table ifthe input block does not correspond to the predetermined value; andstoring an identifier of a second portion of the look-up table if theinput block does correspond to the predetermined value,wherein thelook-up table is a 2^(2y) xm table, the data block is a y-bit data blockand the identifiers of the first portion and the second portion arey-bit identifiers.
 6. A method of converting an input data streamincluding a sequence of input data blocks into a converted streamsuitable for addressing a look-up table, the method comprising the stepsof:determining if an input block of the input data stream corresponds toa predetermined value; combining the input block with apreviously-stored identifier of a first portion of the look-up table ifthe input block does not correspond to the predetermined value; andstoring an identifier of a second portion of the look-up table if theinput block does correspond to the predetermined value,wherein thelook-up table is a 256×16 table, the data block is a 4-bit data blockand the identifiers of the first portion and the second portion are4-bit identifiers.
 7. An apparatus for converting an input data streamincluding a sequence of input data blocks into a converted streamsuitable for addressing a look-up table, the apparatus comprising:acomparator having an input connected to receive an input block of theinput data stream, and an output providing a signal indicative ofwhether the input block corresponds to a predetermined value; and acircuit connected to the comparator and receiving the signal therefrom,the circuit operative to combine the input block with apreviously-stored identifier of a first portion of the look-up table ifthe input block does not correspond to the predetermined value, and tostore an identifier of a second portion of the look-up table if theinput block does correspond to the predetermined value.
 8. The apparatusof claim 7 wherein the circuit connected to the comparator includes aninput connected to receive a subsequent input block of the input datasequence, and wherein the circuit is further operative to store thesubsequent input block as the identifier of the second portion.
 9. Theapparatus of claim 7 wherein the circuit is further operative to accessthe look-up table using an address corresponding to a combination of theinput block with the previously-stored identifier of the first portionof the look-up table.
 10. The apparatus of claim 7 wherein the circuitfurther includes an input connected to receive a subsequent data blockof the input data sequence, and an output corresponding to an addressrepresenting a combination of the subsequent data block with thepreviously-stored identifier of a first portion of the look-up table.11. The apparatus of claim 7 wherein the circuit further includes aninput connected to receive a subsequent data block of the input datasequence, and an output corresponding to an address representing acombination of the subsequent data block with the stored identifier of asecond portion of the look-up table.
 12. The apparatus of claim 7wherein the look-up table is a 2^(2y) xm table, the data block is ay-bit data block and the identifiers of the first portion and the secondportion are y-bit identifiers.
 13. The apparatus of claim 7 wherein thelook-up table is a 256×16 table, the data block is a 4-bit data blockand the identifiers of the first portion and the second portion are4-bit identifiers.
 14. An apparatus for converting an input data streamincluding a sequence of input data blocks into a converted stream, theapparatus comprising:a look-up table having a plurality of input addresslines, wherein a first set of the input address lines are connected toreceive an input block of the input data stream; a comparator having aninput connected to receive an input block of the input data stream, andan output providing a signal indicative of whether the input blockcorresponds to a predetermined value; and a first register having a loadsignal input coupled to the output of the comparator, a data inputconnected to receive an input block of the data stream, and an outputcoupled to a second set of the input address lines of the look-up table,the register storing an identifier of a first portion of the look-uptable, the register loading the input block as an identifier of a secondportion of the look-up table if the input block corresponds to thepredetermined value, and supplying the previously stored identifier of afirst portion of the look-up table to the output of said register if theinput block does not correspond to the predetermined value.
 15. Theapparatus of claim 14 further including a multiplexer having an outputconnected to the first set of input address lines of the look-up table,a first input connected to receive a current input data block, a secondinput connected to receive a previously-stored input data block, and aselect input coupled to the output of the comparator, such that themultiplexer supplies one of the current input data block or thepreviously-stored input data block to the first set of input addresslines depending upon the output of the comparator.
 16. The apparatus ofclaim 14 wherein the look-up table is a 2^(2y) xm table, the first andsecond sets of input address lines each include y lines, and the inputdata block and stored identifiers each include y bits.
 17. The apparatusof claim 14 wherein the look-up table is a 256×16 table, the first andsecond sets of input address lines each include 4 lines, and the inputdata block and stored identifiers each include 4 bits.
 18. The apparatusof claim 14 further including a second register coupled between theoutput of the comparator and the load signal input of the firstregister.
 19. The apparatus of claim 18 wherein the second registerprovides a delay sufficient to allow a subsequent input data block toreach the first register.